From: Nikita Sobolev Date: Mon, 11 Mar 2024 13:25:04 +0000 (+0300) Subject: gh-116590: Fix unused `current_thread_holds_gil` function warning (#116591) X-Git-Tag: v3.13.0a5~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=817fe33a1da747c57b467f73a47b701c0b0eb911;p=thirdparty%2FPython%2Fcpython.git gh-116590: Fix unused `current_thread_holds_gil` function warning (#116591) --- diff --git a/Python/ceval_gil.c b/Python/ceval_gil.c index f5c44307a513..edfc466d9f20 100644 --- a/Python/ceval_gil.c +++ b/Python/ceval_gil.c @@ -417,6 +417,7 @@ PyEval_ThreadsInitialized(void) return _PyEval_ThreadsInitialized(); } +#ifndef NDEBUG static inline int 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); } +#endif static void init_shared_gil(PyInterpreterState *interp, struct _gil_runtime_state *gil)