Skip to content

Commit

Permalink
gh-117657: Quiet more TSAN warnings due to incorrect modeling of comp…
Browse files Browse the repository at this point in the history
…are/exchange (#117830)
  • Loading branch information
mpage authored Apr 15, 2024
1 parent 6e0b327 commit 0d52383
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0d52383

Please sign in to comment.