diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/pystate.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index 8489f53..8bec727 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -2408,6 +2408,7 @@ _PyThread_CurrentFrames(void) * Because these lists can mutate even when the GIL is held, we * need to grab head_mutex for the duration. */ + _PyEval_StopTheWorldAll(runtime); HEAD_LOCK(runtime); PyInterpreterState *i; for (i = runtime->interpreters.head; i != NULL; i = i->next) { @@ -2441,6 +2442,7 @@ fail: done: HEAD_UNLOCK(runtime); + _PyEval_StartTheWorldAll(runtime); return result; } @@ -2472,6 +2474,7 @@ _PyThread_CurrentExceptions(void) * Because these lists can mutate even when the GIL is held, we * need to grab head_mutex for the duration. */ + _PyEval_StopTheWorldAll(runtime); HEAD_LOCK(runtime); PyInterpreterState *i; for (i = runtime->interpreters.head; i != NULL; i = i->next) { @@ -2504,6 +2507,7 @@ fail: done: HEAD_UNLOCK(runtime); + _PyEval_StartTheWorldAll(runtime); return result; } |