The GIL may be disabled concurrently with this call so we need to use a
relaxed atomic load.
static inline int
_PyEval_IsGILEnabled(PyThreadState *tstate)
{
- return tstate->interp->ceval.gil->enabled != 0;
+ struct _gil_runtime_state *gil = tstate->interp->ceval.gil;
+ return _Py_atomic_load_int_relaxed(&gil->enabled) != 0;
}
// Enable or disable the GIL used by the interpreter that owns tstate, which
race_top:make_pending_calls
race_top:set_add_entry
race_top:should_intern_string
-race_top:_PyEval_IsGILEnabled
race_top:llist_insert_tail
race_top:_Py_slot_tp_getattr_hook
race_top:add_threadstate