Merge branch 'master' of ssh://demsky.eecs.uci.edu/home/git/model-checker-benchmarks
[model-checker-benchmarks.git] / mcs-lock / mcs-lock.cc
index 26e5a27edb76da058cc352eabd5c300a8fdb0ca8..ec0cc5df9d55c904d3a5cf9a677f42488371a7bb 100644 (file)
@@ -14,12 +14,19 @@ void threadA(void *arg)
        mcs_mutex::guard g(mutex);
        printf("store: %d\n", 17);
        store_32(&shared, 17);
+       mutex->unlock(&g);
+       mutex->lock(&g);
+       printf("load: %u\n", load_32(&shared));
 }
 
 void threadB(void *arg)
 {
        mcs_mutex::guard g(mutex);
        printf("load: %u\n", load_32(&shared));
+       mutex->unlock(&g);
+       mutex->lock(&g);
+       printf("store: %d\n", 17);
+       store_32(&shared, 17);
 }
 
 int user_main(int argc, char **argv)