]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-123828: Fix data race in `_interpchannels._waiting_release` (GH-124107)
authorNadeshiko Manju <me@manjusaka.me>
Wed, 1 Oct 2025 11:34:47 +0000 (19:34 +0800)
committerGitHub <noreply@github.com>
Wed, 1 Oct 2025 11:34:47 +0000 (11:34 +0000)
Lib/test/test__interpchannels.py
Modules/_interpchannelsmodule.c

index 858d31a73cf4f458b7faa4a67c248c0436fe6ceb..d7cf77368ef9f2e7e8a78b3e0219f8769843b2b9 100644 (file)
@@ -6,7 +6,7 @@ import threading
 import time
 import unittest
 
-from test.support import import_helper, skip_if_sanitizer
+from test.support import import_helper
 
 _channels = import_helper.import_module('_interpchannels')
 from concurrent.interpreters import _crossinterp
@@ -365,7 +365,6 @@ class ChannelIDTests(TestBase):
         #self.assertIsNot(got, obj)
 
 
-@skip_if_sanitizer('gh-129824: race on _waiting_release', thread=True)
 class ChannelTests(TestBase):
 
     def test_create_cid(self):
index 9c1f861516127587d51135719f58d6758fe18d36..274bfacfed874b166d3fa62f0202f8a50408b7bd 100644 (file)
@@ -511,12 +511,12 @@ _waiting_release(_waiting_t *waiting, int received)
     assert(!waiting->received);
 
     waiting->status = WAITING_RELEASING;
-    PyThread_release_lock(waiting->mutex);
     if (waiting->received != received) {
         assert(received == 1);
         waiting->received = received;
     }
     waiting->status = WAITING_RELEASED;
+    PyThread_release_lock(waiting->mutex);
 }
 
 static void