From 2238c96ecda3b083eafbfcc3c2d8ebf2ade79d50 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 10 Nov 2006 15:51:03 +0000 Subject: [PATCH] Add "memory" as clobber to the asm used by barrier(). Otherwise at least some versions of GCC assume that no changes to memory can take place. --- src/threads/synch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/threads/synch.h b/src/threads/synch.h index 6b8f550..9e464e3 100644 --- a/src/threads/synch.h +++ b/src/threads/synch.h @@ -45,6 +45,6 @@ void cond_broadcast (struct condition *, struct lock *); The compiler will not reorder operations across an optimization barrier. */ -#define barrier() asm volatile ("") +#define barrier() asm volatile ("" : : : "memory") #endif /* threads/synch.h */ -- 2.30.2