Skip to content
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

gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL #118645

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/c-api/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ state:

.. versionadded:: 3.9

.. c:function:: int PyModule_ExperimentalSetGIL(PyObject *module, void *gil)
.. c:function:: int PyUnstable_Module_SetGIL(PyObject *module, void *gil)

Indicate that *module* does or does not support running without the global
interpreter lock (GIL), using one of the values from
Expand Down
2 changes: 1 addition & 1 deletion Include/moduleobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ struct PyModuleDef_Slot {
#endif

#if !defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED)
PyAPI_FUNC(int) PyModule_ExperimentalSetGIL(PyObject *module, void *gil);
PyAPI_FUNC(int) PyUnstable_Module_SetGIL(PyObject *module, void *gil);
#endif

struct PyModuleDef {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Extension modules may indicate to the runtime that they can run without the
GIL. Multi-phase init modules do so by calling providing
``Py_MOD_GIL_NOT_USED`` for the ``Py_mod_gil`` slot, while single-phase init
modules call ``PyModule_ExperimentalSetGIL(mod, Py_MOD_GIL_NOT_USED)`` from
modules call ``PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED)`` from
their init function.
2 changes: 1 addition & 1 deletion Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -4753,7 +4753,7 @@ PyInit__curses(void)
if (m == NULL)
return NULL;
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(m, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
#endif

/* Add some symbolic constants to the module */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_datetimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -6985,7 +6985,7 @@ PyInit__datetime(void)
if (mod == NULL)
return NULL;
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(mod, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED);
#endif

if (_datetime_exec(mod) < 0) {
Expand Down
2 changes: 1 addition & 1 deletion Modules/_testbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2902,7 +2902,7 @@ PyInit__testbuffer(void)
return NULL;
}
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(mod, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED);
#endif
if (_testbuffer_exec(mod) < 0) {
Py_DECREF(mod);
Expand Down
2 changes: 1 addition & 1 deletion Modules/_testcapimodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3936,7 +3936,7 @@ PyInit__testcapi(void)
if (m == NULL)
return NULL;
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(m, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
#endif

Py_SET_TYPE(&_HashInheritanceTester_Type, &PyType_Type);
Expand Down
2 changes: 1 addition & 1 deletion Modules/_testclinic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@ PyInit__testclinic(void)
return NULL;
}
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(m, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
#endif
if (PyModule_AddType(m, &TestClass) < 0) {
goto error;
Expand Down
2 changes: 1 addition & 1 deletion Modules/_testclinic_limited.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ PyInit__testclinic_limited(void)
return NULL;
}
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(m, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
#endif
return m;
}
2 changes: 1 addition & 1 deletion Modules/_testexternalinspection.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ PyInit__testexternalinspection(void)
return NULL;
}
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(mod, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED);
#endif
int rc = PyModule_AddIntConstant(mod, "PROCESS_VM_READV_SUPPORTED", HAVE_PROCESS_VM_READV);
if (rc < 0) {
Expand Down
2 changes: 1 addition & 1 deletion Modules/_testlimitedcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PyInit__testlimitedcapi(void)
return NULL;
}
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(mod, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED);
#endif

if (_PyTestLimitedCAPI_Init_Abstract(mod) < 0) {
Expand Down
2 changes: 1 addition & 1 deletion Modules/_testmultiphase.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ PyInit__test_module_state_shared(void)
return NULL;
}
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(module, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED);
#endif

if (PyModule_AddObjectRef(module, "Error", PyExc_Exception) < 0) {
Expand Down
6 changes: 3 additions & 3 deletions Modules/_testsinglephase.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ init__testsinglephase_basic(PyModuleDef *def)
return NULL;
}
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(module, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED);
#endif

module_state *state = &global_state.module;
Expand Down Expand Up @@ -566,7 +566,7 @@ PyInit__testsinglephase_with_reinit(void)
return NULL;
}
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(module, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED);
#endif

assert(get_module_state(module) == NULL);
Expand Down Expand Up @@ -631,7 +631,7 @@ PyInit__testsinglephase_with_state(void)
return NULL;
}
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(module, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED);
#endif

module_state *state = get_module_state(module);
Expand Down
2 changes: 1 addition & 1 deletion Modules/_tkinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -3206,7 +3206,7 @@ PyInit__tkinter(void)
if (m == NULL)
return NULL;
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(m, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
#endif

Tkinter_TclError = PyErr_NewException("_tkinter.TclError", NULL, NULL);
Expand Down
2 changes: 1 addition & 1 deletion Modules/_tracemalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ PyInit__tracemalloc(void)
if (m == NULL)
return NULL;
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(m, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
#endif

if (_PyTraceMalloc_Init() < 0) {
Expand Down
2 changes: 1 addition & 1 deletion Modules/readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ PyInit_readline(void)
if (m == NULL)
return NULL;
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(m, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
#endif

if (PyModule_AddIntConstant(m, "_READLINE_VERSION",
Expand Down
2 changes: 1 addition & 1 deletion Objects/moduleobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ PyModule_FromDefAndSpec2(PyModuleDef* def, PyObject *spec, int module_api_versio

#ifdef Py_GIL_DISABLED
int
PyModule_ExperimentalSetGIL(PyObject *module, void *gil)
PyUnstable_Module_SetGIL(PyObject *module, void *gil)
{
if (!PyModule_Check(module)) {
PyErr_BadInternalCall();
Expand Down
2 changes: 1 addition & 1 deletion Python/bltinmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3125,7 +3125,7 @@ _PyBuiltin_Init(PyInterpreterState *interp)
if (mod == NULL)
return NULL;
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(mod, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED);
#endif
dict = PyModule_GetDict(mod);

Expand Down
2 changes: 1 addition & 1 deletion Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3775,7 +3775,7 @@ _PySys_Create(PyThreadState *tstate, PyObject **sysmod_p)
return _PyStatus_ERR("failed to create a module object");
}
#ifdef Py_GIL_DISABLED
PyModule_ExperimentalSetGIL(sysmod, Py_MOD_GIL_NOT_USED);
PyUnstable_Module_SetGIL(sysmod, Py_MOD_GIL_NOT_USED);
#endif

PyObject *sysdict = PyModule_GetDict(sysmod);
Expand Down
Loading