mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8293547: Add relaxed add_and_fetch for macos aarch64 atomics
Reviewed-by: dholmes, eosterlund
(cherry picked from commit 7a1cb64bc1)
This commit is contained in:
committed by
Vitaly Provodin
parent
e8f9e711ae
commit
02c0d4bb6d
@@ -37,9 +37,13 @@ template<size_t byte_size>
|
||||
struct Atomic::PlatformAdd {
|
||||
template<typename D, typename I>
|
||||
D add_and_fetch(D volatile* dest, I add_value, atomic_memory_order order) const {
|
||||
D res = __atomic_add_fetch(dest, add_value, __ATOMIC_RELEASE);
|
||||
FULL_MEM_BARRIER;
|
||||
return res;
|
||||
if (order == memory_order_relaxed) {
|
||||
return __atomic_add_fetch(dest, add_value, __ATOMIC_RELAXED);
|
||||
} else {
|
||||
D res = __atomic_add_fetch(dest, add_value, __ATOMIC_RELEASE);
|
||||
FULL_MEM_BARRIER;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename D, typename I>
|
||||
|
||||
Reference in New Issue
Block a user