X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2Fdouble-relseq.c;h=2ad1987aebe197ec098e46ff9b1ea354e2f7f085;hb=a47b5b6b7f12dd7b1a9a8ebe866fb33c5f26dc87;hp=5b220eb888c08f81610516d82c7d44f884054cec;hpb=b8b39c87557325a384faa45d0cae56a6f71f52b1;p=model-checker.git diff --git a/test/double-relseq.c b/test/double-relseq.c index 5b220eb..2ad1987 100644 --- a/test/double-relseq.c +++ b/test/double-relseq.c @@ -10,10 +10,10 @@ */ #include +#include +#include -#include "libthreads.h" #include "librace.h" -#include "stdatomic.h" atomic_int x; int var = 0; @@ -28,7 +28,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)); } @@ -37,13 +37,13 @@ static void c(void *obj) atomic_store_explicit(&x, 2, memory_order_relaxed); } -void user_main() +int user_main(int argc, char **argv) { thrd_t t1, t2, t3, t4; atomic_init(&x, 0); - printf("Thread %d: creating 4 threads\n", thrd_current()); + printf("Main thread: creating 4 threads\n"); thrd_create(&t1, (thrd_start_t)&a, NULL); thrd_create(&t2, (thrd_start_t)&b, NULL); thrd_create(&t3, (thrd_start_t)&b, NULL); @@ -53,5 +53,7 @@ void user_main() thrd_join(t2); thrd_join(t3); thrd_join(t4); - printf("Thread %d is finished\n", thrd_current()); + printf("Main thread is finished\n"); + + return 0; }