]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-117300: Use stop the world to make `sys._current_frames` and `sys._current_excepti...
authorSam Gross <colesbury@gmail.com>
Fri, 29 Mar 2024 19:33:06 +0000 (15:33 -0400)
committerGitHub <noreply@github.com>
Fri, 29 Mar 2024 19:33:06 +0000 (15:33 -0400)
commit01bd74eadbc4ff839d39762fae6366f50c1e116e
treedad7fd5f31389305e80f6989b371e2b97b7b4fdb
parent94c97423a9c4969f8ddd4a3aa4aacb99c4d5263d
gh-117300: Use stop the world to make `sys._current_frames` and `sys._current_exceptions` thread-safe. (#117301)

This adds a stop the world pause to make the two functions thread-safe
when the GIL is disabled in the free-threaded build.

Additionally, the main test thread may call `sys._current_exceptions()` as
soon as `g_raised.set()` is called. The background thread may not yet reach
the `leave_g.wait()` line.
Lib/test/test_sys.py
Python/pystate.c