mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Add more checks on the GIL
Issue #10915, #15751, #26558: * PyGILState_Check() now returns 1 (success) before the creation of the GIL and after the destruction of the GIL. It allows to use the function early in Python initialization and late in Python finalization. * Add a flag to disable PyGILState_Check(). Disable PyGILState_Check() when Py_NewInterpreter() is called * Add assert(PyGILState_Check()) to: _Py_dup(), _Py_fstat(), _Py_read() and _Py_write()
This commit is contained in:
parent
08572f68a9
commit
8a1be61849
5 changed files with 52 additions and 5 deletions
|
|
@ -37,6 +37,14 @@ Py_Exit(int sts)
|
|||
exit(sts);
|
||||
}
|
||||
|
||||
#ifdef WITH_THREAD
|
||||
/* Needed by obmalloc.c */
|
||||
int PyGILState_Check(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue