test: add double-read-fv
[model-checker.git] / test / releaseseq.c
index cbb8ef5630111d651788729c75897a845983167c..548f0a822380ae19640cb30197d7ac6e1209fde4 100644 (file)
@@ -5,10 +5,10 @@
  */
 
 #include <stdio.h>
-
 #include <threads.h>
+#include <stdatomic.h>
+
 #include "librace.h"
-#include "stdatomic.h"
 
 atomic_int x;
 int var = 0;
@@ -23,7 +23,7 @@ static void a(void *obj)
 static void b(void *obj)
 {
        int r = atomic_load_explicit(&x, memory_order_acquire);
-       printf("r = %u\n", r);
+       printf("r = %d\n", r);
        printf("load %d\n", load_32(&var));
 }
 
@@ -38,7 +38,7 @@ int user_main(int argc, char **argv)
 
        atomic_init(&x, 0);
 
-       printf("Thread %d: creating 3 threads\n", thrd_current());
+       printf("Main thread: creating 3 threads\n");
        thrd_create(&t1, (thrd_start_t)&a, NULL);
        thrd_create(&t2, (thrd_start_t)&b, NULL);
        thrd_create(&t3, (thrd_start_t)&c, NULL);
@@ -46,7 +46,7 @@ int user_main(int argc, char **argv)
        thrd_join(t1);
        thrd_join(t2);
        thrd_join(t3);
-       printf("Thread %d is finished\n", thrd_current());
+       printf("Main thread is finished\n");
 
        return 0;
 }