mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-117657: Quiet more TSAN warnings due to incorrect modeling of compare/exchange (#117830)
This commit is contained in:
parent
6e0b327690
commit
0d5238373d
1 changed files with 2 additions and 2 deletions
|
@ -2003,7 +2003,7 @@ tstate_try_attach(PyThreadState *tstate)
|
|||
static void
|
||||
tstate_set_detached(PyThreadState *tstate, int detached_state)
|
||||
{
|
||||
assert(tstate->state == _Py_THREAD_ATTACHED);
|
||||
assert(_Py_atomic_load_int_relaxed(&tstate->state) == _Py_THREAD_ATTACHED);
|
||||
#ifdef Py_GIL_DISABLED
|
||||
_Py_atomic_store_int(&tstate->state, detached_state);
|
||||
#else
|
||||
|
@ -2068,7 +2068,7 @@ static void
|
|||
detach_thread(PyThreadState *tstate, int detached_state)
|
||||
{
|
||||
// XXX assert(tstate_is_alive(tstate) && tstate_is_bound(tstate));
|
||||
assert(tstate->state == _Py_THREAD_ATTACHED);
|
||||
assert(_Py_atomic_load_int_relaxed(&tstate->state) == _Py_THREAD_ATTACHED);
|
||||
assert(tstate == current_fast_get());
|
||||
if (tstate->critical_section != 0) {
|
||||
_PyCriticalSection_SuspendAll(tstate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue