about summary refs log tree commit diff
path: root/sysdeps/tile/tilepro/atomic-machine.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/tile/tilepro/atomic-machine.h')
-rw-r--r--sysdeps/tile/tilepro/atomic-machine.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdeps/tile/tilepro/atomic-machine.h b/sysdeps/tile/tilepro/atomic-machine.h
index 702e17d77d..5365929c94 100644
--- a/sysdeps/tile/tilepro/atomic-machine.h
+++ b/sysdeps/tile/tilepro/atomic-machine.h
@@ -83,6 +83,16 @@ int __atomic_update_32 (volatile int *mem, int mask, int addend)
   ({ __typeof (mask) __att1_v = (mask);                 \
     __atomic_update ((mem), ~__att1_v, __att1_v); })
 
+/*
+ * We must use the kernel atomics for atomic_store, since otherwise an
+ * unsynchronized store could become visible after another core's
+ * kernel-atomic implementation had read the memory word in question,
+ * but before it had written the updated value to it, which would
+ * cause the unsynchronized store to be lost.
+ */
+#define atomic_store_relaxed(mem, val) atomic_exchange_acq (mem, val)
+#define atomic_store_release(mem, val) atomic_exchange_rel (mem, val)
+
 #include <sysdeps/tile/atomic-machine.h>
 
 #endif /* atomic-machine.h */