summaryrefslogtreecommitdiff
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2019-02-24 15:40:47 -0800
committerGitHub <noreply@github.com>2019-02-24 15:40:47 -0800
commitef4ac967e2f3a9a18330cc6abe14adb4bc3d0465 (patch)
tree9486fb50d2f39468a7c00de7fb5c05fdd67372e8 /Modules/signalmodule.c
parent463572c8beb59fd9d6850440af48a5c5f4c0c0c9 (diff)
downloadcpython-git-ef4ac967e2f3a9a18330cc6abe14adb4bc3d0465.tar.gz
bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). (GH-11617)
This involves moving the global "pending calls" state to PyInterpreterState. https://bugs.python.org/issue33608
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index f29720bcaf..ac3b6c7c56 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -19,6 +19,7 @@
#include <process.h>
#endif
#endif
+#include "internal/pycore_pystate.h"
#ifdef HAVE_SIGNAL_H
#include <signal.h>
@@ -295,8 +296,10 @@ trip_signal(int sig_num)
{
/* Py_AddPendingCall() isn't signal-safe, but we
still use it for this exceptional case. */
- Py_AddPendingCall(report_wakeup_send_error,
- (void *)(intptr_t) last_error);
+ _Py_AddPendingCall(_PyRuntime.interpreters.main,
+ main_thread,
+ report_wakeup_send_error,
+ (void *)(intptr_t) last_error);
}
}
}
@@ -313,8 +316,10 @@ trip_signal(int sig_num)
{
/* Py_AddPendingCall() isn't signal-safe, but we
still use it for this exceptional case. */
- Py_AddPendingCall(report_wakeup_write_error,
- (void *)(intptr_t)errno);
+ _Py_AddPendingCall(_PyRuntime.interpreters.main,
+ main_thread,
+ report_wakeup_write_error,
+ (void *)(intptr_t)errno);
}
}
}