Add "memory" as clobber to the asm used by barrier().
[pintos-anon] / src / threads / synch.h
index 6b8f550e8798f6b9b916cf15ce8ec72861e283a8..9e464e3876400f60fafbc44a105f859ffd4b6938 100644 (file)
@@ -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 */