[Lldb-commits] [lldb] r109228 - /lldb/trunk/source/Host/linux/Host.cpp

Greg Clayton gclayton at apple.com
Fri Jul 23 08:47:19 PDT 2010


Author: gclayton
Date: Fri Jul 23 10:47:19 2010
New Revision: 109228

URL: http://llvm.org/viewvc/llvm-project?rev=109228&view=rev
Log:
Remove a deadlock condition.  A bit of explanation is needed: When calling 
ThreadCancel in Host::WillTerminate g_monitor_thread may be blocked on a call
to pthread_cond_wait (for example, line 640).  Now, by default, when a 
cancellation request is serviced g_monitor_thread will again own the mutex
guarding the condition variable it was waiting on.  This causes the call to 
SetValue in Host::WillTerminate to hit a deadlock.

The call to SetValue does not appear to be needed, so removing it solves
the issue.

Patch from Stephen Wilson.


Modified:
    lldb/trunk/source/Host/linux/Host.cpp

Modified: lldb/trunk/source/Host/linux/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/Host.cpp?rev=109228&r1=109227&r2=109228&view=diff
==============================================================================
--- lldb/trunk/source/Host/linux/Host.cpp (original)
+++ lldb/trunk/source/Host/linux/Host.cpp Fri Jul 23 10:47:19 2010
@@ -742,7 +742,6 @@
     if (g_monitor_thread != NULL)
     {
         ThreadCancel (g_monitor_thread, NULL);
-        GetChildProcessPredicate ().SetValue (true, eBroadcastAlways);
         ThreadJoin(g_monitor_thread, NULL, NULL);
         g_monitor_thread = NULL;
     }





More information about the lldb-commits mailing list