8000 Fix PyEval_ReInitThreads(). · python/cpython@15fd123 · GitHub
[go: up one dir, main page]

Skip to content

Commit 15fd123

Browse files
Fix PyEval_ReInitThreads().
1 parent 513c658 commit 15fd123

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Python/ceval.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,11 @@ PyEval_ReInitThreads(void)
240240
if (!gil_created())
241241
return;
242242
recreate_gil();
243-
_PyRuntime.main_thread = PyThread_get_thread_ident();
244-
// XXX Set for every interpreter.
245-
current_tstate->interp->ceval.pending.lock = PyThread_allocate_lock();
243+
// This will be reset in make_pending_calls() below.
244+
current_tstate->interp->ceval.pending.lock = NULL;
245+
246246
take_gil(current_tstate);
247+
_PyRuntime.main_thread = PyThread_get_thread_ident();
247248

248249
/* Destroy all threads except the current one */
249250
_PyThreadState_DeleteExcept(current_tstate);

0 commit comments

Comments
 (0)
0