Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9df20bb

Browse files
committed
Add eval breaker check to _PyUopExecute; fixes test_threading
1 parent c1bcd0f commit 9df20bb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Python/ceval.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2792,8 +2792,18 @@ _PyUopExecute(_PyExecutorObject *executor, _PyInterpreterFrame *frame, PyObject
27922792
(long)(instr - (_Py_CODEUNIT *)code->co_code_adaptive));
27932793
}
27942794
#endif
2795+
27952796
PyThreadState *tstate = _PyThreadState_GET();
27962797
_PyUOpExecutorObject *self = (_PyUOpExecutorObject *)executor;
2798+
2799+
// Equivalent to CHECK_EVAL_BREAKER()
2800+
_Py_CHECK_EMSCRIPTEN_SIGNALS_PERIODICALLY();
2801+
if (_Py_atomic_load_relaxed_int32(&tstate->interp->ceval.eval_breaker)) {
2802+
if (_Py_HandlePending(tstate) != 0) {
2803+
goto error;
2804+
}
2805+
}
2806+
27972807
OBJECT_STAT_INC(optimization_traces_executed);
27982808
_Py_CODEUNIT *ip_offset = (_Py_CODEUNIT *)_PyFrame_GetCode(frame)->co_code_adaptive - 1;
27992809
int pc = 0;

0 commit comments

Comments
 (0)