/* Issue #10915, #15751: The GIL API doesn't work with multiple
interpreters: disable PyGILState_Check(). */
- runtime->gilstate.check_enabled = 0;
+ _Py_atomic_store_int_relaxed(&runtime->gilstate.check_enabled, 0);
// XXX Might new_interpreter() have been called without the GIL held?
PyThreadState *save_tstate = _PyThreadState_GET();
PyGILState_Check(void)
{
_PyRuntimeState *runtime = &_PyRuntime;
- if (!runtime->gilstate.check_enabled) {
+ if (!_Py_atomic_load_int_relaxed(&runtime->gilstate.check_enabled)) {
return 1;
}