From 191ab8540c06d18c7735f4b9230f06619f3750bd Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 22 Mar 2002 08:30:32 +0000 Subject: [PATCH] (MEMORY_BARRIER): Define as asm with memory as clobber. --- linuxthreads/internals.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/linuxthreads/internals.h b/linuxthreads/internals.h index 8297c781c82..2159e70b772 100644 --- a/linuxthreads/internals.h +++ b/linuxthreads/internals.h @@ -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() -- 2.47.2