]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(MEMORY_BARRIER): Define as asm with memory as clobber.
authorUlrich Drepper <drepper@redhat.com>
Fri, 22 Mar 2002 08:30:32 +0000 (08:30 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 22 Mar 2002 08:30:32 +0000 (08:30 +0000)
linuxthreads/internals.h

index 8297c781c82e1d67658e98260c19acc6116a0d3a..2159e70b772e3a601381a1b94480898c4e460240 100644 (file)
@@ -398,11 +398,13 @@ static inline pthread_descr thread_self (void)
 }
 
 /* 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.  */
+   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()