mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-123828: Fix data race in _interpchannels._waiting_release (GH-124107)
This commit is contained in:
parent
d0a3eff9d6
commit
f39dea3bae
2 changed files with 2 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from test.support import import_helper, skip_if_sanitizer
|
from test.support import import_helper
|
||||||
|
|
||||||
_channels = import_helper.import_module('_interpchannels')
|
_channels = import_helper.import_module('_interpchannels')
|
||||||
from concurrent.interpreters import _crossinterp
|
from concurrent.interpreters import _crossinterp
|
||||||
|
|
@ -365,7 +365,6 @@ def test_shareable(self):
|
||||||
#self.assertIsNot(got, obj)
|
#self.assertIsNot(got, obj)
|
||||||
|
|
||||||
|
|
||||||
@skip_if_sanitizer('gh-129824: race on _waiting_release', thread=True)
|
|
||||||
class ChannelTests(TestBase):
|
class ChannelTests(TestBase):
|
||||||
|
|
||||||
def test_create_cid(self):
|
def test_create_cid(self):
|
||||||
|
|
|
||||||
|
|
@ -511,12 +511,12 @@ _waiting_release(_waiting_t *waiting, int received)
|
||||||
assert(!waiting->received);
|
assert(!waiting->received);
|
||||||
|
|
||||||
waiting->status = WAITING_RELEASING;
|
waiting->status = WAITING_RELEASING;
|
||||||
PyThread_release_lock(waiting->mutex);
|
|
||||||
if (waiting->received != received) {
|
if (waiting->received != received) {
|
||||||
assert(received == 1);
|
assert(received == 1);
|
||||||
waiting->received = received;
|
waiting->received = received;
|
||||||
}
|
}
|
||||||
waiting->status = WAITING_RELEASED;
|
waiting->status = WAITING_RELEASED;
|
||||||
|
PyThread_release_lock(waiting->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue