Skip to content

Commit

Permalink
pythongh-116749: Disable GIL by default in free-threaded build (pytho…
Browse files Browse the repository at this point in the history
…n#118295)

Switch GIL to disabled by default in free-threaded build so that the
free-threaded CIs catch thread-safety issues.
  • Loading branch information
colesbury authored Apr 26, 2024
1 parent 3e06c7f commit 5a90de0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Python/ceval_gil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 5a90de0

Please sign in to comment.