File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,9 @@ struct atexit_state {
5252 atexit_py_callback * * callbacks ;
5353 int ncallbacks ;
5454 int callback_len ;
55-
55+ #ifdef Py_GIL_DISABLED
5656 PyMutex lock ;
57+ #endif
5758};
5859
5960// Export for '_interpchannels' shared extension
Original file line number Diff line number Diff line change 1212#include "pycore_interp.h" // PyInterpreterState.atexit
1313#include "pycore_pystate.h" // _PyInterpreterState_GET
1414
15+ #ifdef Py_GIL_DISABLED
1516/* Note: anything declared as static in this file assumes the lock is held
1617 * (except for the Python-level functions) */
1718#define _PyAtExit_LOCK (state ) PyMutex_Lock(&state->lock);
1819#define _PyAtExit_UNLOCK (state ) PyMutex_Unlock(&state->lock);
20+ #else
21+ #define _PyAtExit_LOCK (state )
22+ #define _PyAtExit_UNLOCK (state )
23+ #endif
1924
2025/* ===================================================================== */
2126/* Callback machinery. */
You can’t perform that action at this time.
0 commit comments