Skip to content

gh-149225: Expose Py_CriticalSection in Stable ABI#149227

Merged
encukou merged 7 commits intopython:mainfrom
encukou:critical-section-stable-abi-xs
May 4, 2026
Merged

gh-149225: Expose Py_CriticalSection in Stable ABI#149227
encukou merged 7 commits intopython:mainfrom
encukou:critical-section-stable-abi-xs

Conversation

@encukou
Copy link
Copy Markdown
Member

@encukou encukou commented May 1, 2026

@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 1, 2026

Comment thread Doc/c-api/synchronization.rst
@hugovk hugovk added the 3.15 new features, bugs and security fixes label May 1, 2026
Copy link
Copy Markdown
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread Include/critical_section.h Outdated
// Operations that need to lock two objects at once must use
// `Py_BEGIN_CRITICAL_SECTION2()`. You *CANNOT* use nested critical sections
// to lock more than one object at once, because the inner critical section
// may suspend the outer critical sections. This API does not provide a way
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// may suspend the outer critical sections. This API does not provide a way
// may suspend the outer critical sections. This API does not provide a way

@@ -0,0 +1,2 @@
:c:type:`PyCriticalSection` and related functions are added to the Stable
ABI.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you copy also this paragraph to What's New in Python 3.15 > C API changes > New features?

Comment thread Doc/c-api/synchronization.rst
@encukou encukou requested a review from AA-Turner as a code owner May 4, 2026 12:53
@vstinner
Copy link
Copy Markdown
Member

vstinner commented May 4, 2026

Tests / Windows / Build and test (x64, switch-case) (pull_request): Failing after 23m

Oh, the "FAIL: test_got_eof (test.test_ssl.ThreadedTests.test_got_eof)" failure is related to my recent OpenSSL 4 changes. I wrote #149366 to fix the test.

@encukou encukou merged commit 6ca5cdb into python:main May 4, 2026
98 of 102 checks passed
@encukou encukou deleted the critical-section-stable-abi-xs branch May 4, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.15 new features, bugs and security fixes release-blocker

Projects

Development

Successfully merging this pull request may close these issues.

4 participants