We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adb985f commit 53fa94bCopy full SHA for 53fa94b
1 file changed
Python/pystate.c
@@ -1865,7 +1865,6 @@ PyThreadState_Clear(PyThreadState *tstate)
1865
#endif
1866
1867
tstate->_status.cleared = 1;
1868
- tstate->ensure.owned_guard = NULL;
1869
1870
// XXX Call _PyThreadStateSwap(runtime, NULL) here if "current".
1871
// XXX Do it as early in the function as possible.
@@ -3575,10 +3574,7 @@ PyThreadState_Release(PyThreadStateToken *token)
3575
3574
PyThreadState_Clear(tstate);
3576
--tstate->ensure.counter;
3577
}
3578
-
3579
- // This is usually done by PyThreadState_Clear(), but we need to do it
3580
- // manually if we don't own the thread state.
3581
- if (owned_guard != NULL) {
+ else if (owned_guard != NULL) {
3582
tstate->ensure.owned_guard = NULL;
3583
3584
0 commit comments