https://github.com/python/cpython/commit/817fe33a1da747c57b467f73a47b701c0b0eb911
commit: 817fe33a1da747c57b467f73a47b701c0b0eb911
branch: main
author: Nikita Sobolev <[email protected]>
committer: sobolevn <[email protected]>
date: 2024-03-11T16:25:04+03:00
summary:

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

files:
M Python/ceval_gil.c

diff --git a/Python/ceval_gil.c b/Python/ceval_gil.c
index f5c44307a513f8..edfc466d9f20ec 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)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to