Skip to content

Commit

Permalink
pythongh-117657: Quiet more TSAN warnings due to incorrect modeling o…
Browse files Browse the repository at this point in the history
…f compare/exchange (python#117830)
  • Loading branch information
mpage authored and diegorusso committed Apr 17, 2024
1 parent 2b5a7e4 commit f8e2d81
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 f8e2d81

Please sign in to comment.