mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
gh-117511: Make PyMutex public in the non-limited API (#117731)
This commit is contained in:
parent
e8e151d471
commit
3af7263037
18 changed files with 185 additions and 110 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue