diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-07-28 17:32:20 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-07-28 17:32:20 +0000 |
commit | 2d6a9ec9351f974a19eeca4c2326ef9ff701ee37 (patch) | |
tree | e306e8382919dfd8618515a84b0cf9f495868bbf /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h | |
parent | 5ed2b4ba1d87a8f06d7d9c5e7890d913edd44275 (diff) | |
download | bcm5719-llvm-2d6a9ec9351f974a19eeca4c2326ef9ff701ee37.tar.gz bcm5719-llvm-2d6a9ec9351f974a19eeca4c2326ef9ff701ee37.zip |
Clean up vestigial remnants of locking primitives
This finally removes the use of the Mutex and Condition classes. This is an
intricate patch as the Mutex and Condition classes were tied together.
Furthermore, many places had slightly differing uses of time values. Convert
timeout values to relative everywhere to permit the use of
std::chrono::duration, which is required for the use of
std::condition_variable's timeout. Adjust all Condition and related Mutex
classes over to std::{,recursive_}mutex and std::condition_variable.
This change primarily comes at the cost of breaking the TracingMutex which was
based around the Mutex class. It would be possible to write a wrapper to
provide similar functionality, but that is beyond the scope of this change.
llvm-svn: 277011
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h index 2a01bcec260..23568cd4b36 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h @@ -12,6 +12,8 @@ // C Includes // C++ Includes +#include <condition_variable> +#include <mutex> #include <string> #include <queue> #include <vector> @@ -22,7 +24,6 @@ #include "lldb/Core/Communication.h" #include "lldb/Core/Listener.h" #include "lldb/Host/HostThread.h" -#include "lldb/Host/Mutex.h" #include "lldb/Host/Predicate.h" #include "lldb/Host/TimeValue.h" #include "lldb/Interpreter/Args.h" @@ -114,7 +115,7 @@ public: size_t payload_length); bool - GetSequenceMutex(Mutex::Locker& locker, const char *failure_message = nullptr); + GetSequenceMutex(std::unique_lock<std::recursive_mutex> &lock, const char *failure_message = nullptr); PacketType CheckForPacket (const uint8_t *src, @@ -285,9 +286,9 @@ protected: uint32_t m_echo_number; LazyBool m_supports_qEcho; #ifdef ENABLE_MUTEX_ERROR_CHECKING - TrackingMutex m_sequence_mutex; +#error TrackingMutex is no longer supported #else - Mutex m_sequence_mutex; // Restrict access to sending/receiving packets to a single thread at a time + std::recursive_mutex m_sequence_mutex; // Restrict access to sending/receiving packets to a single thread at a time #endif Predicate<bool> m_public_is_running; Predicate<bool> m_private_is_running; @@ -320,7 +321,7 @@ protected: bool sync_on_timeout); bool - WaitForNotRunningPrivate (const TimeValue *timeout_ptr); + WaitForNotRunningPrivate(const std::chrono::microseconds &timeout); bool CompressionIsEnabled () @@ -364,8 +365,8 @@ protected: private: std::queue<StringExtractorGDBRemote> m_packet_queue; // The packet queue - lldb_private::Mutex m_packet_queue_mutex; // Mutex for accessing queue - Condition m_condition_queue_not_empty; // Condition variable to wait for packets + std::mutex m_packet_queue_mutex; // Mutex for accessing queue + std::condition_variable m_condition_queue_not_empty; // Condition variable to wait for packets HostThread m_listen_thread; std::string m_listen_url; |