]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-105716: Support Background Threads in Subinterpreters Consistently (gh-109921)
authorEric Snow <ericsnowcurrently@gmail.com>
Mon, 2 Oct 2023 20:12:12 +0000 (14:12 -0600)
committerGitHub <noreply@github.com>
Mon, 2 Oct 2023 20:12:12 +0000 (20:12 +0000)
commit1dd9dee45d2591b4e701039d1673282380696849
tree14199e2d03ef74ca575d64552676d4797d792d9c
parenta040a32ea2f13f16172394d3e3e3f80f47f25a68
gh-105716: Support Background Threads in Subinterpreters Consistently (gh-109921)

The existence of background threads running on a subinterpreter was preventing interpreters from getting properly destroyed, as well as impacting the ability to run the interpreter again. It also affected how we wait for non-daemon threads to finish.

We add PyInterpreterState.threads.main, with some internal C-API functions.
Include/cpython/pystate.h
Include/internal/pycore_interp.h
Include/internal/pycore_pystate.h
Lib/test/test_interpreters.py
Lib/test/test_threading.py
Lib/threading.py
Misc/NEWS.d/next/Core and Builtins/2023-09-26-14-00-25.gh-issue-105716.SUJkW1.rst [new file with mode: 0644]
Modules/_threadmodule.c
Modules/_xxsubinterpretersmodule.c
Modules/main.c
Python/pystate.c