Skip to content

Commit db567ea

Browse files
committed
[lldb][NFC] Format part of ScriptInterpreterPython.cpp
Was flagged in #124735 but done separately so it didn't get in the way of that.
1 parent 9ea64dd commit db567ea

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,14 @@ struct InitializePythonRAII {
152152

153153
private:
154154
void InitializeThreadsPrivate() {
155-
// Since Python 3.7 `Py_Initialize` calls `PyEval_InitThreads` inside itself,
156-
// so there is no way to determine whether the embedded interpreter
157-
// was already initialized by some external code. `PyEval_ThreadsInitialized`
158-
// would always return `true` and `PyGILState_Ensure/Release` flow would be
159-
// executed instead of unlocking GIL with `PyEval_SaveThread`. When
160-
// an another thread calls `PyGILState_Ensure` it would get stuck in deadlock.
155+
// Since Python 3.7 `Py_Initialize` calls `PyEval_InitThreads` inside
156+
// itself, so there is no way to determine whether the embedded interpreter
157+
// was already initialized by some external code.
158+
// `PyEval_ThreadsInitialized` would always return `true` and
159+
// `PyGILState_Ensure/Release` flow would be executed instead of unlocking
160+
// GIL with `PyEval_SaveThread`. When an another thread calls
161+
// `PyGILState_Ensure` it would get stuck in deadlock.
162+
161163
// The only case we should go further and acquire the GIL: it is unlocked.
162164
if (PyGILState_Check())
163165
return;

0 commit comments

Comments
 (0)