Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a free-threading race in finalization by asserting the thread list is non-empty only after stopping the world.
2 changes: 1 addition & 1 deletion Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -3827,8 +3827,8 @@ handle_thread_shutdown_exception(PyThreadState *tstate)
assert(tstate != NULL);
assert(_PyErr_Occurred(tstate));
PyInterpreterState *interp = tstate->interp;
assert(interp->threads.head != NULL);
_PyEval_StopTheWorld(interp);
assert(interp->threads.head != NULL); /* safe: world is stopped */

// We don't have to worry about locking this because the
// world is stopped.
Expand Down
Loading