From 8c9e42bffb9e201e5622cd67f1a91311fb471e07 Mon Sep 17 00:00:00 2001 From: "mhammond%skippinet.com.au" Date: Tue, 30 Dec 2003 23:15:33 +0000 Subject: [PATCH] Don't keep the Python thread-lock - this prevents secondary threads from starting. Not part of the build. git-svn-id: svn://10.0.0.236/trunk@150791 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/extensions/python/xpcom/src/loader/pyloader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mozilla/extensions/python/xpcom/src/loader/pyloader.cpp b/mozilla/extensions/python/xpcom/src/loader/pyloader.cpp index d595651098c..8d23db715cc 100644 --- a/mozilla/extensions/python/xpcom/src/loader/pyloader.cpp +++ b/mozilla/extensions/python/xpcom/src/loader/pyloader.cpp @@ -202,7 +202,10 @@ extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr, PyThreadState_Delete(threadStateSave); } #else - PyGILState_Release(state); + // If we initialized Python, then we will also have acquired the thread + // lock. In that case, we want to leave it unlocked, so other threads + // are free to run, even if they aren't running Python code. + PyGILState_Release(bDidInitPython ? PyGILState_UNLOCKED : state); #endif NS_TIMELINE_STOP_TIMER("PyXPCOM: Python threadstate setup");