From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 11 Jun 2026 10:10:55 +0000 (+0200) Subject: [3.15] gh-151177: Fix race condition in `_testembed` (GH-151293) (GH-151312) X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=491768da4c7ffcc38809724d4d9c4a67e7131b9d;p=thirdparty%2FPython%2Fcpython.git [3.15] gh-151177: Fix race condition in `_testembed` (GH-151293) (GH-151312) gh-151177: Fix race condition in `_testembed` (GH-151293) (cherry picked from commit f9ffca39351b77197e4dc2775a0d1e4ad64bf0e5) Co-authored-by: Peter Bierma --- diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 278984ddb17c..fa223c24b2e7 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -2710,8 +2710,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