Mailing List Archive

gh-116749: Disable GIL by default in free-threaded build (#118295)
https://github.com/python/cpython/commit/5a90de0d4cbc151a6deea36a27eb81b192410e56
commit: 5a90de0d4cbc151a6deea36a27eb81b192410e56
branch: main
author: Sam Gross <colesbury@gmail.com>
committer: colesbury <colesbury@gmail.com>
date: 2024-04-26T14:22:29-04:00
summary:

gh-116749: Disable GIL by default in free-threaded build (#118295)

Switch GIL to disabled by default in free-threaded build so that the
free-threaded CIs catch thread-safety issues.

files:
M Python/ceval_gil.c

diff --git a/Python/ceval_gil.c b/Python/ceval_gil.c
index c3c2c54b199c59..fdbb4882c3d711 100644
--- a/Python/ceval_gil.c
+++ b/Python/ceval_gil.c
@@ -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));

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-leave@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: list-python-checkins@lists.gossamer-threads.com