0
0
mirror of https://github.com/python/cpython.git synced 2024-11-21 12:59:38 +01:00

gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL (GH-118645)

This commit is contained in:
Petr Viktorin 2024-05-06 18:59:36 +02:00 committed by GitHub
parent 3ed3bc379a
commit 417dd3aca7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 21 additions and 21 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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.

View File

@ -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 */

View File

@ -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) {

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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;
@ -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);
@ -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);

View File

@ -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);

View File

@ -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) {

View File

@ -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",

View File

@ -439,7 +439,7 @@ error:
#ifdef Py_GIL_DISABLED
int
PyModule_ExperimentalSetGIL(PyObject *module, void *gil)
PyUnstable_Module_SetGIL(PyObject *module, void *gil)
{
if (!PyModule_Check(module)) {
PyErr_BadInternalCall();

View File

@ -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);

View File

@ -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);