2 #if defined (ACE_HAS_GCC_ATOMIC_BUILTINS) && (ACE_HAS_GCC_ATOMIC_BUILTINS == 1)
4 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
8 ACE_Atomic_Op_GCC<T>::ACE_Atomic_Op_GCC ()
15 ACE_Atomic_Op_GCC<T>::ACE_Atomic_Op_GCC (T c)
22 ACE_Atomic_Op_GCC<T>::ACE_Atomic_Op_GCC (
23 const ACE_Atomic_Op_GCC<T> &rhs)
30 ACE_Atomic_Op_GCC<T>::operator++ ()
32 return __atomic_add_fetch (&value_, 1, __ATOMIC_ACQ_REL);
37 ACE_Atomic_Op_GCC<T>::operator++ (int)
39 return __atomic_fetch_add (&value_, 1, __ATOMIC_ACQ_REL);
44 ACE_Atomic_Op_GCC<T>::operator-- ()
46 return __atomic_sub_fetch (&value_, 1, __ATOMIC_ACQ_REL);
51 ACE_Atomic_Op_GCC<T>::operator-- (int)
53 return __atomic_fetch_sub (&value_, 1, __ATOMIC_ACQ_REL);
58 ACE_Atomic_Op_GCC<T>::operator+= (T rhs)
60 return __atomic_add_fetch (&value_, rhs, __ATOMIC_ACQ_REL);
65 ACE_Atomic_Op_GCC<T>::operator-= (T rhs)
67 return __atomic_sub_fetch (&value_, rhs, __ATOMIC_ACQ_REL);
72 ACE_Atomic_Op_GCC<T>::operator== (T rhs) const
74 return __atomic_load_n (&value_, __ATOMIC_CONSUME) == rhs;
79 ACE_Atomic_Op_GCC<T>::operator!= (T rhs) const
81 return __atomic_load_n (&value_, __ATOMIC_CONSUME) != rhs;
86 ACE_Atomic_Op_GCC<T>::operator>= (T rhs) const
88 return __atomic_load_n (&value_, __ATOMIC_CONSUME) >= rhs;
93 ACE_Atomic_Op_GCC<T>::operator> (T rhs) const
95 return __atomic_load_n (&value_, __ATOMIC_CONSUME) > rhs;
100 ACE_Atomic_Op_GCC<T>::operator<= (T rhs) const
102 return __atomic_load_n (&value_, __ATOMIC_CONSUME) <= rhs;
105 template <typename T>
107 ACE_Atomic_Op_GCC<T>::operator< (T rhs) const
109 return __atomic_load_n (&value_, __ATOMIC_CONSUME) < rhs;
112 template <typename T>
113 ACE_INLINE ACE_Atomic_Op_GCC<T> &
114 ACE_Atomic_Op_GCC<T>::operator= (T rhs)
116 __atomic_store_n (&value_, rhs, __ATOMIC_RELEASE);
120 template <typename T>
121 ACE_INLINE ACE_Atomic_Op_GCC<T> &
122 ACE_Atomic_Op_GCC<T>::operator= (
123 const ACE_Atomic_Op_GCC<T> &rhs)
125 __atomic_store_n (&value_, __atomic_load_n (&rhs.value_, __ATOMIC_CONSUME), __ATOMIC_RELEASE);
129 template <typename T>
131 ACE_Atomic_Op_GCC<T>::exchange (T newval)
133 return __atomic_exchange_n (&value_, newval, __ATOMIC_ACQ_REL);
136 template <typename T>
138 ACE_Atomic_Op_GCC<T>::value () const
140 return __atomic_load_n (&value_, __ATOMIC_CONSUME);
143 template <typename T>
144 ACE_INLINE volatile T &
145 ACE_Atomic_Op_GCC<T>::value_i ()
150 ACE_END_VERSIONED_NAMESPACE_DECL
152 #endif /* ACE_HAS_GCC_ATOMIC_BUILTINS */