File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -229,12 +229,7 @@ _PyContext_Exit(PyThreadState *ts, PyObject *octx)
229229{
230230 ENSURE_Context (octx , -1 )
231231 PyContext * ctx = (PyContext * )octx ;
232- #ifdef Py_GIL_DISABLED
233- int already_entered = _Py_atomic_exchange_int (& ctx -> ctx_entered , 0 );
234- #else
235- int already_entered = ctx -> ctx_entered ;
236- ctx -> ctx_entered = 0 ;
237- #endif
232+ int already_entered = FT_ATOMIC_LOAD_INT_RELAXED (ctx -> ctx_entered );
238233
239234 if (!already_entered ) {
240235 PyErr_Format (PyExc_RuntimeError ,
@@ -253,6 +248,7 @@ _PyContext_Exit(PyThreadState *ts, PyObject *octx)
253248 Py_SETREF (ts -> context , (PyObject * )ctx -> ctx_prev );
254249
255250 ctx -> ctx_prev = NULL ;
251+ FT_ATOMIC_STORE_INT (ctx -> ctx_entered , 0 );
256252 context_switched (ts );
257253 return 0 ;
258254}
You can’t perform that action at this time.
0 commit comments