Split up the Python script interpreter code to allow multiple script interpreter objects to
exist within the same process (one script interpreter object per debugger object).  The
python script interpreter objects are all using the same global Python script interpreter;
they use separate dictionaries to keep their data separate, and mutex's to prevent any object
attempting to use the global Python interpreter when another object is already using it.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123415 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/lldb.cpp b/source/lldb.cpp
index 47f403d..05c7f4b 100644
--- a/source/lldb.cpp
+++ b/source/lldb.cpp
@@ -14,6 +14,7 @@
 #include "lldb/Core/Timer.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/Mutex.h"
+#include "lldb/Interpreter/ScriptInterpreter.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 
@@ -53,7 +54,7 @@
 lldb_private::Initialize ()
 {
     // Make sure we inialize only once
-    static Mutex g_inited_mutex(Mutex::eMutexTypeNormal);
+    static Mutex g_inited_mutex(Mutex::eMutexTypeRecursive);
     static bool g_inited = false;
 
     Mutex::Locker locker(g_inited_mutex);
@@ -75,6 +76,7 @@
         UnwindAssemblyProfiler_x86::Initialize();
         ArchDefaultUnwindPlan_x86::Initialize();
         ArchVolatileRegs_x86::Initialize();
+        ScriptInterpreter::Initialize ();
 
 #ifdef __APPLE__
         ABIMacOSX_i386::Initialize();
@@ -114,6 +116,7 @@
     UnwindAssemblyProfiler_x86::Terminate();
     ArchDefaultUnwindPlan_x86::Terminate();
     ArchVolatileRegs_x86::Terminate();
+    ScriptInterpreter::Terminate ();
 
 #ifdef __APPLE__
     DynamicLoaderMacOSXDYLD::Terminate();