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/MacOSX-Kernel | |
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/MacOSX-Kernel')
3 files changed, 4 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp index 29a0d58f708..b0a6a54616c 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp @@ -210,11 +210,10 @@ CommunicationKDP::GetSequenceMutex(std::unique_lock<std::recursive_mutex> &lock) return (lock = std::unique_lock<std::recursive_mutex>(m_sequence_mutex, std::try_to_lock)).owns_lock(); } - bool -CommunicationKDP::WaitForNotRunningPrivate (const TimeValue *timeout_ptr) +CommunicationKDP::WaitForNotRunningPrivate(const std::chrono::microseconds &timeout) { - return m_is_running.WaitForValueEqualTo (false, timeout_ptr, NULL); + return m_is_running.WaitForValueEqualTo(false, timoeut, NULL); } size_t diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h index 89e55a561e7..fe77cbb9ae4 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h @@ -249,7 +249,7 @@ protected: uint32_t timeout_usec); bool - WaitForNotRunningPrivate (const lldb_private::TimeValue *timeout_ptr); + WaitForNotRunningPrivate(const std::chrono::microseconds &timeout); void MakeRequestPacketHeader (CommandType request_type, diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp index 898677df616..7782f42d916 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -941,7 +941,7 @@ ProcessKDP::AsyncThread (void *arg) if (log) log->Printf ("ProcessKDP::AsyncThread (pid = %" PRIu64 ") listener.WaitForEvent (NULL, event_sp)...", pid); - if (listener_sp->WaitForEvent (NULL, event_sp)) + if (listener_sp->WaitForEvent(stsd::chrono::micrseconds(0), event_sp)) { uint32_t event_type = event_sp->GetType(); if (log) |