]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-112075: Add critical sections for most dict APIs (#114508)
authorDino Viehland <dinoviehland@meta.com>
Tue, 6 Feb 2024 22:03:43 +0000 (14:03 -0800)
committerGitHub <noreply@github.com>
Tue, 6 Feb 2024 22:03:43 +0000 (14:03 -0800)
commit92abb0124037e5bc938fa870461a26f64c56095b
tree3f3e6789befc115364c2ab2e893084ba616e63a7
parentb6228b521b4692b2de1c1c12f4aa5623f8319084
gh-112075: Add critical sections for most dict APIs (#114508)

Starts adding thread safety to dict objects.

Use @critical_section for APIs which are exposed via argument clinic and don't directly correlate with a public C API which needs to acquire the lock
Use a _lock_held suffix for keeping changes to complicated functions simple and just wrapping them with a critical section
Acquire and release the lock in an existing function where it won't be overly disruptive to the existing logic
Include/internal/pycore_critical_section.h
Modules/_sre/sre.c
Objects/clinic/dictobject.c.h
Objects/dictobject.c
Objects/odictobject.c
Objects/setobject.c