< prev index next >

src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.hpp

Print this page




  71     T value = compare_value;
  72     FULL_MEM_BARRIER;
  73     __atomic_compare_exchange(dest, &value, &exchange_value, /*weak*/false,
  74                               __ATOMIC_RELAXED, __ATOMIC_RELAXED);
  75     FULL_MEM_BARRIER;
  76     return value;
  77   }
  78 }
  79 
  80 template<size_t byte_size>
  81 struct Atomic::PlatformOrderedLoad<byte_size, X_ACQUIRE>
  82 {
  83   template <typename T>
  84   T operator()(const volatile T* p) const { T data; __atomic_load(const_cast<T*>(p), &data, __ATOMIC_ACQUIRE); return data; }
  85 };
  86 
  87 template<size_t byte_size>
  88 struct Atomic::PlatformOrderedStore<byte_size, RELEASE_X>
  89 {
  90   template <typename T>
  91   void operator()(T v, volatile T* p) const { __atomic_store(const_cast<T*>(p), &v, __ATOMIC_RELEASE); }
  92 };
  93 
  94 template<size_t byte_size>
  95 struct Atomic::PlatformOrderedStore<byte_size, RELEASE_X_FENCE>
  96 {
  97   template <typename T>
  98   void operator()(T v, volatile T* p) const { release_store(p, v); OrderAccess::fence(); }
  99 };
 100 
 101 #endif // OS_CPU_LINUX_AARCH64_ATOMIC_LINUX_AARCH64_HPP


  71     T value = compare_value;
  72     FULL_MEM_BARRIER;
  73     __atomic_compare_exchange(dest, &value, &exchange_value, /*weak*/false,
  74                               __ATOMIC_RELAXED, __ATOMIC_RELAXED);
  75     FULL_MEM_BARRIER;
  76     return value;
  77   }
  78 }
  79 
  80 template<size_t byte_size>
  81 struct Atomic::PlatformOrderedLoad<byte_size, X_ACQUIRE>
  82 {
  83   template <typename T>
  84   T operator()(const volatile T* p) const { T data; __atomic_load(const_cast<T*>(p), &data, __ATOMIC_ACQUIRE); return data; }
  85 };
  86 
  87 template<size_t byte_size>
  88 struct Atomic::PlatformOrderedStore<byte_size, RELEASE_X>
  89 {
  90   template <typename T>
  91   void operator()(volatile T* p, T v) const { __atomic_store(const_cast<T*>(p), &v, __ATOMIC_RELEASE); }
  92 };
  93 
  94 template<size_t byte_size>
  95 struct Atomic::PlatformOrderedStore<byte_size, RELEASE_X_FENCE>
  96 {
  97   template <typename T>
  98   void operator()(volatile T* p, T v) const { release_store(p, v); OrderAccess::fence(); }
  99 };
 100 
 101 #endif // OS_CPU_LINUX_AARCH64_ATOMIC_LINUX_AARCH64_HPP
< prev index next >