We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f9e499 commit 0dba178Copy full SHA for 0dba178
1 file changed
Python/pystate.c
@@ -2691,7 +2691,12 @@ PyGILState_Ensure(void)
2691
called Py_Initialize(). */
2692
2693
/* Ensure that _PyEval_InitThreads() and _PyGILState_Init() have been
2694
- called by Py_Initialize() */
+ called by Py_Initialize()
2695
+
2696
+ TODO: This isn't thread-safe. There's no protection here against
2697
+ concurrent finalization of the interpreter; it's simply a guard
2698
+ for *after* the interpreter has finalized.
2699
+ */
2700
if (!_PyEval_ThreadsInitialized() || runtime->gilstate.autoInterpreterState == NULL) {
2701
PyThread_hang_thread();
2702
}
0 commit comments