]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-59956: Allow the "Trashcan" Mechanism to Work Without a Thread State (gh-101209)
authorEric Snow <ericsnowcurrently@gmail.com>
Mon, 23 Jan 2023 15:30:20 +0000 (08:30 -0700)
committerGitHub <noreply@github.com>
Mon, 23 Jan 2023 15:30:20 +0000 (08:30 -0700)
commit7b20a0f55a16b3e2d274cc478e4d04bd8a836a9f
treec2b341aca1b1298d230d44a76be1960a62d77cd6
parent984387f39a3385ed5699bd7e21797c348e543b19
gh-59956: Allow the "Trashcan" Mechanism to Work Without a Thread State (gh-101209)

We've factored out a struct from the two PyThreadState fields. This accomplishes two things:

* make it clear that the trashcan-related code doesn't need any other parts of PyThreadState
* allows us to use the trashcan mechanism even when there isn't a "current" thread state

We still expect the caller to hold the GIL.

https://github.com/python/cpython/issues/59956
Include/cpython/object.h
Include/cpython/pystate.h
Include/internal/pycore_runtime.h
Objects/object.c
Python/pystate.c