gh-116590: Fix unused current_thread_holds_gil function warning (#116591)

This commit is contained in:
Nikita Sobolev 2024-03-11 16:25:04 +03:00 committed by GitHub
parent ffd79bea0f
commit 817fe33a1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -417,6 +417,7 @@ PyEval_ThreadsInitialized(void)
return _PyEval_ThreadsInitialized(); return _PyEval_ThreadsInitialized();
} }
#ifndef NDEBUG
static inline int static inline int
current_thread_holds_gil(struct _gil_runtime_state *gil, PyThreadState *tstate) current_thread_holds_gil(struct _gil_runtime_state *gil, PyThreadState *tstate)
{ {
@ -425,6 +426,7 @@ current_thread_holds_gil(struct _gil_runtime_state *gil, PyThreadState *tstate)
} }
return _Py_atomic_load_int_relaxed(&gil->locked); return _Py_atomic_load_int_relaxed(&gil->locked);
} }
#endif
static void static void
init_shared_gil(PyInterpreterState *interp, struct _gil_runtime_state *gil) init_shared_gil(PyInterpreterState *interp, struct _gil_runtime_state *gil)