mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
gh-141780: Make PyModule_FromSlotsAndSpec enable GIL if needed (GH-141785)
This commit is contained in:
parent
6462322840
commit
bf66bce4ee
9 changed files with 183 additions and 22 deletions
|
|
@ -128,11 +128,18 @@ PyAPI_FUNC(int) _PyImport_ClearExtension(PyObject *name, PyObject *filename);
|
|||
// state of the module argument:
|
||||
// - If module is NULL or a PyModuleObject with md_gil == Py_MOD_GIL_NOT_USED,
|
||||
// call _PyEval_DisableGIL().
|
||||
// - Otherwise, call _PyEval_EnableGILPermanent(). If the GIL was not already
|
||||
// enabled permanently, issue a warning referencing the module's name.
|
||||
// - Otherwise, call _PyImport_EnableGILAndWarn
|
||||
//
|
||||
// This function may raise an exception.
|
||||
extern int _PyImport_CheckGILForModule(PyObject *module, PyObject *module_name);
|
||||
// Assuming that the GIL is enabled from a call to
|
||||
// _PyEval_EnableGILTransient(), call _PyEval_EnableGILPermanent().
|
||||
// If the GIL was not already enabled permanently, issue a warning referencing
|
||||
// the module's name.
|
||||
// Leave a message in verbose mode.
|
||||
//
|
||||
// This function may raise an exception.
|
||||
extern int _PyImport_EnableGILAndWarn(PyThreadState *, PyObject *module_name);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue