summaryrefslogtreecommitdiff
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 24dbd4255a..ef3536a210 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -1779,10 +1779,11 @@ PyOS_FiniInterrupts(void)
finisignal();
}
+
+// The caller doesn't have to hold the GIL
int
-PyOS_InterruptOccurred(void)
+_PyOS_InterruptOccurred(PyThreadState *tstate)
{
- PyThreadState *tstate = _PyThreadState_GET();
_Py_EnsureTstateNotNULL(tstate);
if (!_Py_ThreadCanHandleSignals(tstate->interp)) {
return 0;
@@ -1797,6 +1798,15 @@ PyOS_InterruptOccurred(void)
}
+// The caller must to hold the GIL
+int
+PyOS_InterruptOccurred(void)
+{
+ PyThreadState *tstate = _PyThreadState_GET();
+ return _PyOS_InterruptOccurred(tstate);
+}
+
+
#ifdef HAVE_FORK
static void
_clear_pending_signals(void)