Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/test/test_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,8 @@ def g456():
# And the next record must be for g456().
filename, lineno, funcname, sourceline = stack[i+1]
self.assertEqual(funcname, "g456")
self.assertTrue(sourceline.startswith("if leave_g.wait("))
self.assertTrue((sourceline.startswith("if leave_g.wait(") or
sourceline.startswith("g_raised.set()")))
finally:
# Reap the spawned thread.
leave_g.set()
Expand Down
4 changes: 4 additions & 0 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2406,6 +2406,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) {
Expand Down Expand Up @@ -2439,6 +2440,7 @@ _PyThread_CurrentFrames(void)

done:
HEAD_UNLOCK(runtime);
_PyEval_StartTheWorldAll(runtime);
return result;
}

Expand Down Expand Up @@ -2470,6 +2472,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) {
Expand Down Expand Up @@ -2502,6 +2505,7 @@ _PyThread_CurrentExceptions(void)

done:
HEAD_UNLOCK(runtime);
_PyEval_StartTheWorldAll(runtime);
return result;
}

Expand Down