Skip to content

Commit f019bd6

Browse files
Clear bound_gilstate for the old thread state.
1 parent 5be78e9 commit f019bd6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Python/pystate.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,11 @@ bind_gilstate_tstate(PyThreadState *tstate)
290290
assert(tstate != tcur);
291291

292292
if (tcur != NULL) {
293+
// The original gilstate implementation only respects the
294+
// first thread state set.
293295
// XXX Skipping like this does not play nice with multiple interpreters.
294296
return;
297+
tcur->_status.bound_gilstate = 0;
295298
}
296299
gilstate_tss_set(runtime, tstate);
297300
tstate->_status.bound_gilstate = 1;

0 commit comments

Comments
 (0)