]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116590: Fix unused `current_thread_holds_gil` function warning (#116591)
authorNikita Sobolev <mail@sobolevn.me>
Mon, 11 Mar 2024 13:25:04 +0000 (16:25 +0300)
committerGitHub <noreply@github.com>
Mon, 11 Mar 2024 13:25:04 +0000 (16:25 +0300)
Python/ceval_gil.c

index f5c44307a513f83604d5dda3291c44f83e7f82a3..edfc466d9f20ec02a8f2ead46b4165e0a262caac 100644 (file)
@@ -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)