mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
gh-109693: Update _gil_runtime_state.locked to use pyatomic.h (gh-110836)
This commit is contained in:
parent
06f844eaa0
commit
86559ddfec
8 changed files with 86 additions and 18 deletions
|
|
@ -854,6 +854,23 @@ _Py_atomic_store_ptr_release(void *obj, void *value)
|
|||
memory_order_release);
|
||||
}
|
||||
|
||||
static inline void
|
||||
_Py_atomic_store_int_release(int *obj, int value)
|
||||
{
|
||||
_Py_USING_STD;
|
||||
atomic_store_explicit((_Atomic(int)*)obj, value,
|
||||
memory_order_release);
|
||||
}
|
||||
|
||||
static inline int
|
||||
_Py_atomic_load_int_acquire(const int *obj)
|
||||
{
|
||||
_Py_USING_STD;
|
||||
return atomic_load_explicit((const _Atomic(int)*)obj,
|
||||
memory_order_acquire);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// --- _Py_atomic_fence ------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue