summaryrefslogtreecommitdiff
path: root/devel/linuxthreads/files/patch-barrier
blob: f60402d634c0c9c4a1fa13fe011a2142c8d03e93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- internals.h.orig	Tue May 16 00:23:50 2006
+++ internals.h	Tue May 16 00:24:21 2006
@@ -395,12 +395,14 @@
 #endif
 }
 
-/* If MEMORY_BARRIER isn't defined in pt-machine.h, assume the architecture
-   doesn't need a memory barrier instruction (e.g. Intel x86).  Some
-   architectures distinguish between full, read and write barriers.  */
+/* If MEMORY_BARRIER isn't defined in pt-machine.h, assume the
+   architecture doesn't need a memory barrier instruction (e.g. Intel
+   x86).  Still we need the compiler to respect the barrier and emit
+   all outstanding operations which modify memory.  Some architectures
+   distinguish between full, read and write barriers.  */
 
 #ifndef MEMORY_BARRIER
-#define MEMORY_BARRIER()
+#define MEMORY_BARRIER() asm ("" : : : "memory")
 #endif
 #ifndef READ_MEMORY_BARRIER
 #define READ_MEMORY_BARRIER() MEMORY_BARRIER()