From: Ulrich Drepper Date: Fri, 22 Mar 2002 08:30:32 +0000 (+0000) Subject: (MEMORY_BARRIER): Define as asm with memory as clobber. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=191ab8540c06d18c7735f4b9230f06619f3750bd;p=thirdparty%2Fglibc.git (MEMORY_BARRIER): Define as asm with memory as clobber. --- 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()