gh-117511: Make PyMutex public in the non-limited API (#117731)

This commit is contained in:
Sam Gross 2024-06-20 11:29:08 -04:00 committed by GitHub
parent e8e151d471
commit 3af7263037
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 185 additions and 110 deletions

View file

@ -137,17 +137,13 @@ struct _object {
// fields have been merged.
#define _Py_UNOWNED_TID 0
// NOTE: In non-free-threaded builds, `struct _PyMutex` is defined in
// pycore_lock.h. See pycore_lock.h for more details.
struct _PyMutex { uint8_t v; };
struct _object {
// ob_tid stores the thread id (or zero). It is also used by the GC and the
// trashcan mechanism as a linked list pointer and by the GC to store the
// computed "gc_refs" refcount.
uintptr_t ob_tid;
uint16_t _padding;
struct _PyMutex ob_mutex; // per-object lock
PyMutex ob_mutex; // per-object lock
uint8_t ob_gc_bits; // gc-related state
uint32_t ob_ref_local; // local reference count
Py_ssize_t ob_ref_shared; // shared (atomic) reference count