diff options
| author | Tian Gao <gaogaotiantian@hotmail.com> | 2023-10-12 14:10:21 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-12 14:10:21 (GMT) |
| commit | 1e3460d9faaffb35b3c6175c666b1f45aea2c1d8 (patch) | |
| tree | 99291e8b24ff7f597bf0279e51024dda4f41fc4a | |
| parent | b6000d287407cbccfbb1157dc1fc6128497badc7 (diff) | |
| download | cpython-1e3460d9faaffb35b3c6175c666b1f45aea2c1d8.zip cpython-1e3460d9faaffb35b3c6175c666b1f45aea2c1d8.tar.gz cpython-1e3460d9faaffb35b3c6175c666b1f45aea2c1d8.tar.bz2 | |
gh-110752: Reset `ceval.eval_breaker` to 0 in `interpreter_clear` (GH-110753)
| -rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2023-10-12-06-32-25.gh-issue-110752.FYfI0h.rst | 1 | ||||
| -rw-r--r-- | Python/pystate.c | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-10-12-06-32-25.gh-issue-110752.FYfI0h.rst b/Misc/NEWS.d/next/Core and Builtins/2023-10-12-06-32-25.gh-issue-110752.FYfI0h.rst new file mode 100644 index 0000000..fa1a59e --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-10-12-06-32-25.gh-issue-110752.FYfI0h.rst @@ -0,0 +1 @@ +Reset ``ceval.eval_breaker`` in :func:`interpreter_clear` diff --git a/Python/pystate.c b/Python/pystate.c index 2086bd6..92cf741 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -890,6 +890,10 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate) Py_CLEAR(interp->audit_hooks); + // At this time, all the threads should be cleared so we don't need + // atomic operations for eval_breaker + interp->ceval.eval_breaker = 0; + for (int i = 0; i < _PY_MONITORING_UNGROUPED_EVENTS; i++) { interp->monitors.tools[i] = 0; } |
