8000 gh-116167: Allow disabling the GIL with `PYTHON_GIL=0` or `-X gil=0` by swtaarrs · Pull Request #116338 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-116167: Allow disabling the GIL with PYTHON_GIL=0 or -X gil=0 #116338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 11, 2024
Prev Previous commit
Next Next commit
Set enable_gil properly when PYTHON_GIL=1
  • Loading branch information
swtaarrs committed Mar 5, 2024
commit e0b848403bbfcaac74dac74fe6fc45c3d3a6e679
4 changes: 3 additions & 1 deletion Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,9 @@ config_read_env_vars(PyConfig *config)
#ifdef Py_GIL_DISABLED
if (strcmp(gil, "0") == 0) {
config->enable_gil = _PyConfig_GIL_DISABLE;
} else if (strcmp(gil, "1") != 0) {
} else if (strcmp(gil, "1") == 0) {
config->enable_gil = _PyConfig_GIL_ENABLE;
} else {
return _PyStatus_ERR("PYTHON_GIL must be \"0\" or \"1\"");
}
#else
Expand Down
0