]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-126914: Store the Preallocated Thread State's Pointer in a PyInterpreterSta...
authorEric Snow <ericsnowcurrently@gmail.com>
Mon, 2 Dec 2024 18:41:57 +0000 (11:41 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Dec 2024 18:41:57 +0000 (18:41 +0000)
commit219b8266db52508eb947fa1ba2cf4aa9e8569685
tree80a5c08ebcb507c5b0bf912d30de068c0f322cef
parent059114c0a0bc60c1d180eefa54e8483e3a8e9b5e
[3.13] gh-126914: Store the Preallocated Thread State's Pointer in a PyInterpreterState Field (gh-127114)

This approach eliminates the originally reported race.  It also gets rid of the deadlock reported in gh-96071, so we can remove the workaround added then.

This is mostly a cherry-pick of 1c0a104 (AKA gh-126989).  The difference is we add PyInterpreterState.threads_preallocated at the end of PyInterpreterState, instead of adding PyInterpreterState.threads.preallocated.  That avoids ABI disruption.
Doc/data/python3.13.abi
Include/internal/pycore_interp.h
Lib/test/test_interpreters/test_stress.py
Python/pystate.c