From: Peter Bierma Date: Thu, 11 Jun 2026 09:06:48 +0000 (-0400) Subject: gh-151177: Fix race condition in `_testembed` (GH-151293) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9ffca39351b77197e4dc2775a0d1e4ad64bf0e5;p=thirdparty%2FPython%2Fcpython.git gh-151177: Fix race condition in `_testembed` (GH-151293) --- diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 7246cc06ffff..74d0fe37ddae 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -2715,8 +2715,8 @@ do_tstate_ensure(void *arg) PyThreadState_Release(tokens[2]); PyThreadState_Release(tokens[1]); PyThreadState_Release(tokens[0]); - PyInterpreterGuard_Close(guard); _Py_atomic_store_int(&data->done, 1); + PyInterpreterGuard_Close(guard); } static int