Skip to content

Commit ca00e74

Browse files
committed
Fix non-debug build.
1 parent b97a4b4 commit ca00e74

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Include/internal/pycore_typeobject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

3738
extern PyStatus _PyTypes_InitTypes(PyInterpreterState *);

Objects/typeobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

8280
static bool
8381
types_world_is_stopped(void)
@@ -110,12 +108,14 @@ types_start_world(void)
110108
assert(!types_world_is_stopped());
111109
}
112110

111+
#ifdef Py_DEBUG
113112
static bool
114113
types_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

120120
static void
121121
types_mutex_set_owned(PyThread_ident_t tid)

0 commit comments

Comments
 (0)