mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
[3.9] bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578) (GH-20618)
* bpo-40826: Add _Py_EnsureTstateNotNULL() macro (GH-20571) Add _Py_EnsureTstateNotNULL(tstate) macro: call Py_FatalError() if tstate is NULL, the error message contains the current function name. (cherry picked from commit3026cad59b
) * bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578) PyOS_InterruptOccurred() now fails with a fatal error if it is called with the GIL released. (cherry picked from commitcbe1296922
)
This commit is contained in:
parent
5d2396c8cf
commit
6d62dc1ea4
8 changed files with 43 additions and 31 deletions
|
@ -1784,7 +1784,7 @@ PyOS_FiniInterrupts(void)
|
|||
int
|
||||
_PyOS_InterruptOccurred(PyThreadState *tstate)
|
||||
{
|
||||
assert(tstate != NULL);
|
||||
_Py_EnsureTstateNotNULL(tstate);
|
||||
if (!_Py_ThreadCanHandleSignals(tstate->interp)) {
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue