]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-115432: Add critical section variant that handles a NULL object (#115433)
authorSam Gross <colesbury@gmail.com>
Thu, 15 Feb 2024 13:37:54 +0000 (08:37 -0500)
committerGitHub <noreply@github.com>
Thu, 15 Feb 2024 13:37:54 +0000 (08:37 -0500)
commitad4f909e0e7890e027c4ae7fea74586667242ad3
tree30037776c2fe7eadb8eda0ecf0df302ef8f5a681
parentb0e5c35ded6d4a16d7a021c10c99bac94250edd0
gh-115432: Add critical section variant that handles a NULL object (#115433)

This adds `Py_XBEGIN_CRITICAL_SECTION` and
`Py_XEND_CRITICAL_SECTION`, which accept a possibly NULL object as an
argument. If the argument is NULL, then nothing is locked or unlocked.
Otherwise, they behave like `Py_BEGIN/END_CRITICAL_SECTION`.
Include/internal/pycore_critical_section.h
Modules/_testinternalcapi/test_critical_sections.c