X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fthreads%2Fsynch.h;h=a19e88b181dff1208839ff890154aa69b299ce91;hb=8b801a69f8e0c2c4ef7e32a2476786f80f433b8e;hp=53a5ee488cf07c83f68a7b136bc6506136180ac9;hpb=615bf3b3d2a8573ed6fb9ddc0055745e163ac999;p=pintos-anon diff --git a/src/threads/synch.h b/src/threads/synch.h index 53a5ee4..a19e88b 100644 --- a/src/threads/synch.h +++ b/src/threads/synch.h @@ -41,10 +41,11 @@ void cond_wait (struct condition *, struct lock *); void cond_signal (struct condition *, struct lock *); void cond_broadcast (struct condition *, struct lock *); -/* Memory barrier. +/* Optimization barrier. - The compiler will not reorder operations that access memory - across a memory barrier. */ -#define barrier() asm volatile ("") + The compiler will not reorder operations across an + optimization barrier. See "Optimization Barriers" in the + reference guide for more information.*/ +#define barrier() asm volatile ("" : : : "memory") #endif /* threads/synch.h */