]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-114203: Optimise simple recursive critical sections (#128126)
authorT. Wouters <thomas@python.org>
Mon, 23 Dec 2024 12:31:33 +0000 (04:31 -0800)
committerGitHub <noreply@github.com>
Mon, 23 Dec 2024 12:31:33 +0000 (13:31 +0100)
commit180d417e9f9456defd4c5b53cae678c318287921
treecdcc1e622b3e5a11f61d739dd514dde31048e643
parent831b6de6d725c697f2f61fd35c4448cd8a9354ff
gh-114203: Optimise simple recursive critical sections (#128126)

Add a fast path to (single-mutex) critical section locking _iff_ the mutex
is already held by the currently active, top-most critical section of this
thread. This can matter a lot for indirectly recursive critical sections
without intervening critical sections.
Include/internal/pycore_critical_section.h
Misc/NEWS.d/next/Core_and_Builtins/2024-12-20-23-07-33.gh-issue-114203.84NgoW.rst [new file with mode: 0644]
Python/critical_section.c