Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59830b6

Browse files
committed
revert tstate_delete_common, since it's pretty much wrong
1 parent 95d7519 commit 59830b6

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

Python/pystate.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,7 @@ PyThreadState_DeleteCurrent()
425425
_Py_atomic_store_relaxed(&_PyThreadState_Current, NULL);
426426
if (autoInterpreterState && PyThread_get_key_value(autoTLSkey) == tstate)
427427
PyThread_delete_key_value(autoTLSkey);
428-
/*
429-
Only call tstate_delete_common to have the tstate if we're not finalizing
430-
or we're the main thread. The main thread will do this for us. Not calling
431-
tstate_delete_common means we won't lock the interpreter head lock,
432-
avoiding a possible deadlock with the GIL.
433-
*/
434-
if (!_Py_Finalizing || _Py_Finalizing == tstate)
435-
tstate_delete_common(tstate);
428+
tstate_delete_common(tstate);
436429
PyEval_ReleaseLock();
437430
}
438431
#endif /* WITH_THREAD */

0 commit comments

Comments
 (0)