@@ -258,6 +258,7 @@ trip_signal(int sig_num)
258258
259259 /* Notify ceval.c */
260260 _PyRuntimeState * runtime = & _PyRuntime ;
261+ PyThreadState * tstate = _PyRuntimeState_GetThreadState (runtime );
261262 _PyEval_SignalReceived (& runtime -> ceval );
262263
263264 /* And then write to the wakeup fd *after* setting all the globals and
@@ -298,7 +299,7 @@ trip_signal(int sig_num)
298299 {
299300 /* Py_AddPendingCall() isn't signal-safe, but we
300301 still use it for this exceptional case. */
301- _PyEval_AddPendingCall (& runtime -> ceval ,
302+ _PyEval_AddPendingCall (tstate , & runtime -> ceval ,
302303 report_wakeup_send_error ,
303304 (void * )(intptr_t ) last_error );
304305 }
@@ -317,7 +318,7 @@ trip_signal(int sig_num)
317318 {
318319 /* Py_AddPendingCall() isn't signal-safe, but we
319320 still use it for this exceptional case. */
320- _PyEval_AddPendingCall (& runtime -> ceval ,
321+ _PyEval_AddPendingCall (tstate , & runtime -> ceval ,
321322 report_wakeup_write_error ,
322323 (void * )(intptr_t )errno );
323324 }
0 commit comments