From 4ceb928f022d16ba7db1521bd2e8722dd41ec1c4 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Fri, 8 Jun 2012 22:50:40 +0000 Subject: Change the Mutex::Locker class so that it takes the Mutex object and locks it, rather than being given the pthread_mutex_t from the Mutex and locks that. That allows us to track ownership of the Mutex better. Used this to switch the LLDB_CONFIGURATION_DEBUG enabled assert when we can't get the gdb-remote sequence mutex to assert when the thread that had the mutex releases it. This is generally more useful information than saying just who failed to get it (since the code that had it locked often had released it by the time the assert fired.) llvm-svn: 158240 --- .../Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 90fb47eb7a3c..b08350a5ec83 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1939,7 +1939,7 @@ GDBRemoteCommunicationClient::GetCurrentThreadIDs (std::vector &thr Mutex::Locker locker; thread_ids.clear(); - if (GetSequenceMutex (locker)) + if (GetSequenceMutex (locker, "ProcessGDBRemote::UpdateThreadList() failed due to not getting the sequence mutex")) { sequence_mutex_unavailable = false; StringExtractorGDBRemote response; @@ -1968,9 +1968,13 @@ GDBRemoteCommunicationClient::GetCurrentThreadIDs (std::vector &thr } else { +#if defined (LLDB_CONFIGURATION_DEBUG) + // assert(!"ProcessGDBRemote::UpdateThreadList() failed due to not getting the sequence mutex"); +#else LogSP log (ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet (GDBR_LOG_PROCESS | GDBR_LOG_PACKETS)); if (log) log->Printf("error: failed to get packet sequence mutex, not sending packet 'qfThreadInfo'"); +#endif sequence_mutex_unavailable = true; } return thread_ids.size(); -- cgit v1.2.3