File tree 3 files changed +5
-4
lines changed
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ struct _types_runtime_state {
22
22
// bpo-42745: next_version_tag remains shared by all interpreters
23
23
// because of static types.
24
24
unsigned int next_version_tag ;
25
- PyMutex type_mutex ;
26
25
};
27
26
28
27
@@ -71,6 +70,7 @@ struct types_state {
71
70
struct type_cache type_cache ;
72
71
size_t num_builtins_initialized ;
73
72
static_builtin_state builtins [_Py_MAX_STATIC_BUILTIN_TYPES ];
73
+ PyMutex mutex ;
74
74
};
75
75
76
76
Original file line number Diff line number Diff line change @@ -60,17 +60,18 @@ class object "PyObject *" "&PyBaseObject_Type"
60
60
// in odd behaviors w.r.t. running with the GIL as the outer type lock could
61
61
// be released and reacquired during a subclass update if there's contention
62
62
// on the subclass lock.
63
+ #define TYPE_LOCK &PyInterpreterState_Get()->types.mutex
63
64
#define BEGIN_TYPE_LOCK () \
64
65
{ \
65
66
_PyCriticalSection _cs; \
66
- _PyCriticalSection_Begin(&_cs, &_PyRuntime.types.type_mutex); \
67
+ _PyCriticalSection_Begin(&_cs, TYPE_LOCK); \
67
68
68
69
#define END_TYPE_LOCK () \
69
70
_PyCriticalSection_End(&_cs); \
70
71
}
71
72
72
73
#define ASSERT_TYPE_LOCK_HELD () \
73
- _Py_CRITICAL_SECTION_ASSERT_MUTEX_LOCKED(&_PyRuntime.types.type_mutex )
74
+ _Py_CRITICAL_SECTION_ASSERT_MUTEX_LOCKED(TYPE_LOCK )
74
75
75
76
#else
76
77
Original file line number Diff line number Diff line change @@ -395,7 +395,7 @@ _Py_COMP_DIAG_POP
395
395
&(runtime)->atexit.mutex, \
396
396
&(runtime)->audit_hooks.mutex, \
397
397
&(runtime)->allocators.mutex, \
398
- &(runtime)->types.type_mutex , \
398
+ &(runtime)->_main_interpreter. types.mutex , \
399
399
}
400
400
401
401
static void
You can’t perform that action at this time.
0 commit comments