]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-96017: Fix some compiler warnings (GH-96018) (#96106)
authorChristian Heimes <christian@python.org>
Wed, 5 Oct 2022 22:05:27 +0000 (00:05 +0200)
committerGitHub <noreply@github.com>
Wed, 5 Oct 2022 22:05:27 +0000 (15:05 -0700)
- only define recreate_gil with ifdef HAVE_FORK.
(cherry picked from commit d9c1b746b5013f81d1724757bb3c6a1c87c4a8dc)

Co-authored-by: Christian Heimes <christian@python.org>
Python/ceval_gil.h

index 23f6fb26580eceaf67c5549c3e979a04e5e03fa9..476ed7f1a2dd4bd87d32167b7488b9b37d8171d4 100644 (file)
@@ -133,12 +133,14 @@ static void destroy_gil(struct _gil_runtime_state *gil)
     _Py_ANNOTATE_RWLOCK_DESTROY(&gil->locked);
 }
 
+#ifdef HAVE_FORK
 static void recreate_gil(struct _gil_runtime_state *gil)
 {
     _Py_ANNOTATE_RWLOCK_DESTROY(&gil->locked);
     /* XXX should we destroy the old OS resources here? */
     create_gil(gil);
 }
+#endif
 
 static void
 drop_gil(struct _ceval_runtime_state *ceval, struct _ceval_state *ceval2,