Skip to content

Commit f39dea3

Browse files
authored
gh-123828: Fix data race in _interpchannels._waiting_release (GH-124107)
1 parent d0a3eff commit f39dea3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Lib/test/test__interpchannels.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import time
77
import unittest
88

9-
from test.support import import_helper, skip_if_sanitizer
9+
from test.support import import_helper
1010

1111
_channels = import_helper.import_module('_interpchannels')
1212
from concurrent.interpreters import _crossinterp
@@ -365,7 +365,6 @@ def test_shareable(self):
365365
#self.assertIsNot(got, obj)
366366

367367

368-
@skip_if_sanitizer('gh-129824: race on _waiting_release', thread=True)
369368
class ChannelTests(TestBase):
370369

371370
def test_create_cid(self):

Modules/_interpchannelsmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,12 +511,12 @@ _waiting_release(_waiting_t *waiting, int received)
511511
assert(!waiting->received);
512512

513513
waiting->status = WAITING_RELEASING;
514-
PyThread_release_lock(waiting->mutex);
515514
if (waiting->received != received) {
516515
assert(received == 1);
517516
waiting->received = received;
518517
}
519518
waiting->status = WAITING_RELEASED;
519+
PyThread_release_lock(waiting->mutex);
520520
}
521521

522522
static void

0 commit comments

Comments
 (0)