]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116749: Disable GIL by default in free-threaded build (#118295)
authorSam Gross <colesbury@gmail.com>
Fri, 26 Apr 2024 18:22:29 +0000 (14:22 -0400)
committerGitHub <noreply@github.com>
Fri, 26 Apr 2024 18:22:29 +0000 (14:22 -0400)
Switch GIL to disabled by default in free-threaded build so that the
free-threaded CIs catch thread-safety issues.

Python/ceval_gil.c

index c3c2c54b199c59c594a3eb6f158cef6ad17bd73b..fdbb4882c3d71171fc21e2f025fb58d854ee35e8 100644 (file)
@@ -451,9 +451,7 @@ init_own_gil(PyInterpreterState *interp, struct _gil_runtime_state *gil)
 {
     assert(!gil_created(gil));
 #ifdef Py_GIL_DISABLED
-    // gh-116329: Once it is safe to do so, change this condition to
-    // (enable_gil == _PyConfig_GIL_ENABLE), so the GIL is disabled by default.
-    gil->enabled = _PyInterpreterState_GetConfig(interp)->enable_gil != _PyConfig_GIL_DISABLE;
+    gil->enabled = _PyInterpreterState_GetConfig(interp)->enable_gil == _PyConfig_GIL_ENABLE;
 #endif
     create_gil(gil);
     assert(gil_created(gil));