6 /* For data race instrumentation */
9 struct mcs_mutex *mutex;
10 static uint32_t shared;
12 void threadA(void *arg)
14 mcs_mutex::guard g(mutex);
16 printf("store: %d\n", 17);
17 store_32(&shared, 17);
21 void threadB(void *arg)
23 mcs_mutex::guard g(mutex);
25 printf("load: %u\n", load_32(&shared));
29 int user_main(int argc, char **argv)
33 mutex = new mcs_mutex();
35 thrd_create(&A, &threadA, NULL);
36 thrd_create(&B, &threadB, NULL);