File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ static inline void opal_atomic_wmb(void)
7070
7171static inline void opal_atomic_rmb (void )
7272{
73- # if OPAL_ASSEMBLY_ARCH == OPAL_X86_64
73+ # if OPAL_ASSEMBLY_ARCH == OPAL_X86_64 && defined( PLATFORM_COMPILER_GNU ) && __GNUC__ < 8
7474 /* work around a bug in older gcc versions (observed in gcc 6.x)
7575 * where acquire seems to get treated as a no-op instead of being
7676 * equivalent to __asm__ __volatile__("": : :"memory") on x86_64 */
@@ -241,12 +241,12 @@ typedef atomic_flag opal_atomic_lock_t;
241241 */
242242static inline void opal_atomic_lock_init (opal_atomic_lock_t * lock , bool value )
243243{
244- atomic_flag_clear (lock );
244+ atomic_flag_clear_explicit (lock , memory_order_relaxed );
245245}
246246
247247static inline int opal_atomic_trylock (opal_atomic_lock_t * lock )
248248{
249- return (int ) atomic_flag_test_and_set (lock );
249+ return (int ) atomic_flag_test_and_set_explicit (lock , memory_order_acquire );
250250}
251251
252252static inline void opal_atomic_lock (opal_atomic_lock_t * lock )
@@ -257,7 +257,7 @@ static inline void opal_atomic_lock(opal_atomic_lock_t *lock)
257257
258258static inline void opal_atomic_unlock (opal_atomic_lock_t * lock )
259259{
260- atomic_flag_clear (lock );
260+ atomic_flag_clear_explicit (lock , memory_order_release );
261261}
262262
263263# if OPAL_HAVE_C11_CSWAP_INT128
You can’t perform that action at this time.
0 commit comments