Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix PyEval_ReInitThreads().
  • Loading branch information
ericsnowcurrently committed Feb 23, 2019
commit 15fd1234c6a61d2a4093a043490dba967a317577
7 changes: 4 additions & 3 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,11 @@ PyEval_ReInitThreads(void)
if (!gil_created())
return;
recreate_gil();
_PyRuntime.main_thread = PyThread_get_thread_ident();
// XXX Set for every interpreter.
current_tstate->interp->ceval.pending.lock = PyThread_allocate_lock();
// This will be reset in make_pending_calls() below.
current_tstate->interp->ceval.pending.lock = NULL;

take_gil(current_tstate);
_PyRuntime.main_thread = PyThread_get_thread_ident();

/* Destroy all threads except the current one */
_PyThreadState_DeleteExcept(current_tstate);
Expand Down