File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ extern "C" {
3232#define _Py_TYPE_BASE_VERSION_TAG (2<<16)
3333#define _Py_MAX_GLOBAL_TYPE_VERSION_TAG (_Py_TYPE_BASE_VERSION_TAG - 1)
3434
35+
3536/* runtime lifecycle */
3637
3738extern PyStatus _PyTypes_InitTypes (PyInterpreterState * );
Original file line number Diff line number Diff line change @@ -72,12 +72,10 @@ class object "PyObject *" "&PyBaseObject_Type"
7272// modifying these, in order to avoid data races.
7373#define TYPE_LOCK &PyInterpreterState_Get()->types.mutex
7474
75- #ifdef Py_DEBUG
7675// Used to check for correct use of the TYPE_LOCK mutex. It is a simple
7776// mutex and does not support re-entrancy. If we already hold the lock and
7877// try to acquire it again with the same thread, it is a bug on the code.
7978#define TYPE_LOCK_TID &PyInterpreterState_Get()->types.mutex_tid
80- #endif
8179
8280static bool
8381types_world_is_stopped (void )
@@ -110,12 +108,14 @@ types_start_world(void)
110108 assert (!types_world_is_stopped ());
111109}
112110
111+ #ifdef Py_DEBUG
113112static bool
114113types_mutex_is_owned (void )
115114{
116115 PyThread_ident_t tid = PyThread_get_thread_ident_ex ();
117116 return _Py_atomic_load_ullong_relaxed (TYPE_LOCK_TID ) == tid ;
118117}
118+ #endif
119119
120120static void
121121types_mutex_set_owned (PyThread_ident_t tid )
You can’t perform that action at this time.
0 commit comments