]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-119344: Make critical section API public (#119353)
authorSam Gross <colesbury@gmail.com>
Fri, 21 Jun 2024 19:50:18 +0000 (15:50 -0400)
committerGitHub <noreply@github.com>
Fri, 21 Jun 2024 19:50:18 +0000 (15:50 -0400)
commit8f17d69b7bc906e8407095317842cc0fd52cd84a
tree316f24eb7d801391c24e2c0bf8a54bc1a846a1b7
parent03fa2df92707b543c304a426732214002f81d671
gh-119344: Make critical section API public (#119353)

This makes the following macros public as part of the non-limited C-API for
locking a single object or two objects at once.

* `Py_BEGIN_CRITICAL_SECTION(op)` / `Py_END_CRITICAL_SECTION()`
* `Py_BEGIN_CRITICAL_SECTION2(a, b)` / `Py_END_CRITICAL_SECTION2()`

The supporting functions and structs used by the macros are also exposed for
cases where C macros are not available.
15 files changed:
Doc/c-api/init.rst
Include/Python.h
Include/cpython/critical_section.h [new file with mode: 0644]
Include/critical_section.h [new file with mode: 0644]
Include/internal/pycore_critical_section.h
Makefile.pre.in
Misc/NEWS.d/next/C API/2024-05-21-19-41-41.gh-issue-119344.QKvzQb.rst [new file with mode: 0644]
Modules/_sre/sre.c
Modules/_testcapimodule.c
Objects/dictobject.c
Objects/listobject.c
Objects/typeobject.c
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Python/critical_section.c