-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-131185: Use a proper thread-local for cached thread states #132510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ericsnowcurrently
merged 27 commits into
python:main
from
ZeroIntensity:gilstate-thread-local
May 21, 2025
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
4652f0d
Convert the gilstate into a thread-local.
ZeroIntensity 0e93b03
Add a comment.
ZeroIntensity ba4c00e
Add a test case.
ZeroIntensity 2e99092
Fix the test.
ZeroIntensity 6425c3e
Fix the test case (again).
ZeroIntensity 78cd775
Remove unused variable.
ZeroIntensity c8421fc
Add blurb.
ZeroIntensity 0a875ff
Make the C analyzer happy.
ZeroIntensity dd330f8
Fix the C analyzer (round 2).
ZeroIntensity a3c2292
Add test to test_embed
ZeroIntensity 86be7f3
Update Misc/NEWS.d/next/C_API/2025-04-14-07-41-28.gh-issue-131185.ZCj…
ZeroIntensity 453a468
Fix some of the comments.
ZeroIntensity da9b606
Use PyEvent instead of _PySemaphore
ZeroIntensity 55be81c
Merge branch 'gilstate-thread-local' of https://github.com/ZeroIntens…
ZeroIntensity 2f9e499
Fix scalar initializer.
ZeroIntensity 0dba178
Add comment about thread-safety.
ZeroIntensity 863d2bc
Fix header.
ZeroIntensity bbf8aa4
Merge branch 'main' of https://github.com/python/cpython into gilstat…
ZeroIntensity cad0404
Fix renaming.
ZeroIntensity 779be6e
Restore assertion.
ZeroIntensity 86144fc
Clear the thread-local.
ZeroIntensity 9f1d919
Restore trashTSSkey silliness.
ZeroIntensity 79096c8
Merge branch 'main' of https://github.com/python/cpython into gilstat…
ZeroIntensity 0c16fea
Fix broken build.
ZeroIntensity 7c27c9f
Revert "Clear the thread-local."
ZeroIntensity 8f18e95
Reapply "Clear the thread-local."
ZeroIntensity f90bb11
Only remove the evil gilstate clear.
ZeroIntensity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/C_API/2025-04-14-07-41-28.gh-issue-131185.ZCjMHD.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
:c:func:`PyGILState_Ensure` no longer crashes when called after interpreter | ||
finalization. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.