[Lldb-commits] [lldb] r209160 - Don't allow two threads to both be in SBDebugger::Create() due to threading issues in FormatManager.
Greg Clayton
gclayton at apple.com
Mon May 19 13:42:14 PDT 2014
Author: gclayton
Date: Mon May 19 15:42:14 2014
New Revision: 209160
URL: http://llvm.org/viewvc/llvm-project?rev=209160&view=rev
Log:
Don't allow two threads to both be in SBDebugger::Create() due to threading issues in FormatManager.
<rdar://problem/16937126>
Modified:
lldb/trunk/source/API/SBDebugger.cpp
Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=209160&r1=209159&r2=209160&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Mon May 19 15:42:14 2014
@@ -159,6 +159,15 @@ SBDebugger::Create(bool source_init_file
Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
SBDebugger debugger;
+
+ // Currently we have issues if this function is called simultaneously on two different
+ // threads. The issues mainly revolve around the fact that the lldb_private::FormatManager
+ // uses global collections and having two threads parsing the .lldbinit files can cause
+ // mayhem. So to get around this for now we need to use a mutex to prevent bad things
+ // from happening.
+ static Mutex g_mutex(Mutex::eMutexTypeRecursive);
+ Mutex::Locker locker(g_mutex);
+
debugger.reset(Debugger::CreateInstance(callback, baton));
if (log)
More information about the lldb-commits
mailing list