X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Fsynch.h;h=9e464e3876400f60fafbc44a105f859ffd4b6938;hb=6d19139b337fcb7c9b31e5b6724e6ae19499e4c5;hp=53a5ee488cf07c83f68a7b136bc6506136180ac9;hpb=615bf3b3d2a8573ed6fb9ddc0055745e163ac999;p=pintos-anon diff --git a/src/threads/synch.h b/src/threads/synch.h index 53a5ee4..9e464e3 100644 --- a/src/threads/synch.h +++ b/src/threads/synch.h @@ -41,10 +41,10 @@ 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. */ +#define barrier() asm volatile ("" : : : "memory") #endif /* threads/synch.h */