summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorTian Gao <gaogaotiantian@hotmail.com>2023-10-12 14:10:21 (GMT)
committerGitHub <noreply@github.com>2023-10-12 14:10:21 (GMT)
commit1e3460d9faaffb35b3c6175c666b1f45aea2c1d8 (patch)
tree99291e8b24ff7f597bf0279e51024dda4f41fc4a /Python
parentb6000d287407cbccfbb1157dc1fc6128497badc7 (diff)
downloadcpython-1e3460d9faaffb35b3c6175c666b1f45aea2c1d8.zip
cpython-1e3460d9faaffb35b3c6175c666b1f45aea2c1d8.tar.gz
cpython-1e3460d9faaffb35b3c6175c666b1f45aea2c1d8.tar.bz2
gh-110752: Reset `ceval.eval_breaker` to 0 in `interpreter_clear` (GH-110753)
Diffstat (limited to 'Python')
-rw-r--r--Python/pystate.c4
1 files changed, 4 insertions, 0 deletions
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;
}