bpo-40826: PyOS_InterruptOccurred() requires GIL (GH-20578)
PyOS_InterruptOccurred() now fails with a fatal error if it is called with the GIL released.
This commit is contained in:
parent
39de8e4b6f
commit
cbe1296922
|
@ -0,0 +1,2 @@
|
|||
:c:func:`PyOS_InterruptOccurred` now fails with a fatal error if it is
|
||||
called with the GIL released.
|
|
@ -1782,8 +1782,9 @@ PyOS_FiniInterrupts(void)
|
|||
int
|
||||
PyOS_InterruptOccurred(void)
|
||||
{
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
if (!_Py_ThreadCanHandleSignals(interp)) {
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
_Py_EnsureTstateNotNULL(tstate);
|
||||
if (!_Py_ThreadCanHandleSignals(tstate->interp)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue