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/GDBRemoteRegisterContext.cpp | |
| parent | 5ed2b4ba1d87a8f06d7d9c5e7890d913edd44275 (diff) | |
| download | llvm-2d6a9ec9351f974a19eeca4c2326ef9ff701ee37.zip llvm-2d6a9ec9351f974a19eeca4c2326ef9ff701ee37.tar.gz llvm-2d6a9ec9351f974a19eeca4c2326ef9ff701ee37.tar.bz2 | |
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/GDBRemoteRegisterContext.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp index e5b347c..628efd9 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -401,8 +401,8 @@ GDBRemoteRegisterContext::WriteRegisterBytes (const RegisterInfo *reg_info, Data reg_info->byte_size, // dst length m_reg_data.GetByteOrder())) // dst byte order { - Mutex::Locker locker; - if (gdb_comm.GetSequenceMutex (locker, "Didn't get sequence mutex for write register.")) + std::unique_lock<std::recursive_mutex> lock; + if (gdb_comm.GetSequenceMutex(lock, "Didn't get sequence mutex for write register.")) { const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported(); ProcessSP process_sp (m_thread.GetProcess()); @@ -570,8 +570,8 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp) const bool use_g_packet = gdb_comm.AvoidGPackets ((ProcessGDBRemote *)process) == false; - Mutex::Locker locker; - if (gdb_comm.GetSequenceMutex (locker, "Didn't get sequence mutex for read all registers.")) + std::unique_lock<std::recursive_mutex> lock; + if (gdb_comm.GetSequenceMutex(lock, "Didn't get sequence mutex for read all registers.")) { SyncThreadState(process); @@ -679,8 +679,8 @@ GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data const bool use_g_packet = gdb_comm.AvoidGPackets ((ProcessGDBRemote *)process) == false; StringExtractorGDBRemote response; - Mutex::Locker locker; - if (gdb_comm.GetSequenceMutex (locker, "Didn't get sequence mutex for write all registers.")) + std::unique_lock<std::recursive_mutex> lock; + if (gdb_comm.GetSequenceMutex(lock, "Didn't get sequence mutex for write all registers.")) { const bool thread_suffix_supported = gdb_comm.GetThreadSuffixSupported(); ProcessSP process_sp (m_thread.GetProcess()); |
