21
21
#include <process.h>
22
22
#endif
23
23
#endif
24
+ #include "internal/pycore_pystate.h"
24
25
25
26
#ifdef HAVE_SIGNAL_H
26
27
#include <signal.h>
@@ -259,6 +260,7 @@ trip_signal(int sig_num)
259
260
/* Notify ceval.c */
260
261
_PyRuntimeState * runtime = & _PyRuntime ;
261
262
PyThreadState * tstate = _PyRuntimeState_GetThreadState (runtime );
263
+ PyInterpreterState * interp = runtime -> interpreters .main ;
262
264
_PyEval_SignalReceived (& runtime -> ceval );
263
265
264
266
/* And then write to the wakeup fd *after* setting all the globals and
@@ -299,7 +301,10 @@ trip_signal(int sig_num)
299
301
{
300
302
/* Py_AddPendingCall() isn't signal-safe, but we
301
303
still use it for this exceptional case. */
302
- _PyEval_AddPendingCall (tstate , & runtime -> ceval ,
304
+ _PyEval_AddPendingCall (tstate ,
305
+ & runtime -> ceval ,
306
+ & interp -> ceval ,
307
+ runtime -> main_thread ,
303
308
report_wakeup_send_error ,
304
309
(void * )(intptr_t ) last_error );
305
310
}
@@ -318,7 +323,10 @@ trip_signal(int sig_num)
318
323
{
319
324
/* Py_AddPendingCall() isn't signal-safe, but we
320
325
still use it for this exceptional case. */
321
- _PyEval_AddPendingCall (tstate , & runtime -> ceval ,
326
+ _PyEval_AddPendingCall (tstate ,
327
+ & runtime -> ceval ,
328
+ & interp -> ceval ,
329
+ runtime -> main_thread ,
322
330
report_wakeup_write_error ,
323
331
(void * )(intptr_t )errno );
324
332
}
0 commit comments