@@ -9,6 +9,7 @@ extern "C" {
99
1010#include "pycore_ast_state.h" // struct ast_state
1111#include "pycore_llist.h" // struct llist_node
12+ #include "pycore_lock.h" // _PyRecursiveMutex
1213#include "pycore_opcode_utils.h" // NUM_COMMON_CONSTANTS
1314#include "pycore_pymath.h" // _PY_SHORT_FLOAT_REPR
1415#include "pycore_structs.h" // PyHamtObject
@@ -30,10 +31,15 @@ extern "C" {
3031#endif
3132
3233// Executor list lock macros for thread-safe access to executor linked lists
34+ #ifdef Py_GIL_DISABLED
3335#define EXECUTOR_LIST_LOCK (interp ) \
34- FT_MUTEX_LOCK (&(interp)->executor_list_lock)
36+ _PyRecursiveMutex_Lock (&(interp)->executor_list_lock)
3537#define EXECUTOR_LIST_UNLOCK (interp ) \
36- FT_MUTEX_UNLOCK(&(interp)->executor_list_lock)
38+ _PyRecursiveMutex_Unlock(&(interp)->executor_list_lock)
39+ #else
40+ #define EXECUTOR_LIST_LOCK (interp )
41+ #define EXECUTOR_LIST_UNLOCK (interp )
42+ #endif
3743
3844typedef int (* _Py_pending_call_func )(void * );
3945
@@ -946,7 +952,7 @@ struct _is {
946952 struct _PyExecutorObject * cold_executor ;
947953 int executor_deletion_list_remaining_capacity ;
948954#ifdef Py_GIL_DISABLED
949- PyMutex executor_list_lock ;
955+ _PyRecursiveMutex executor_list_lock ;
950956#endif
951957 size_t executor_creation_counter ;
952958 _rare_events rare_events ;
0 commit comments