mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-26 10:10:19 +00:00
8293547: Add relaxed add_and_fetch for macos aarch64 atomics
Reviewed-by: dholmes, eosterlund
This commit is contained in:
parent
68f385c1ca
commit
7a1cb64bc1
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user