do optimization for FuncNode::update_tree
[c11tester.git] / test / linuxrwlocks.c
index 896ae30b2dd54cd97f4e18fda4de60face50e018..3d075aa8e04a4d34673e38e119bc9630f96c30b6 100644 (file)
@@ -1,8 +1,8 @@
 #include <stdio.h>
+#include <threads.h>
+#include <stdatomic.h>
 
-#include "libthreads.h"
 #include "librace.h"
-#include "stdatomic.h"
 
 #define RW_LOCK_BIAS            0x00100000
 #define WRITE_LOCK_CMP          RW_LOCK_BIAS
@@ -84,7 +84,7 @@ int shareddata;
 static void a(void *obj)
 {
        int i;
-       for(i = 0; i < 2; i++) {
+       for(i = 0;i < 2;i++) {
                if ((i % 2) == 0) {
                        read_lock(&mylock);
                        load_32(&shareddata);
@@ -97,7 +97,7 @@ static void a(void *obj)
        }
 }
 
-void user_main()
+int user_main(int argc, char **argv)
 {
        thrd_t t1, t2;
        atomic_init(&mylock.lock, RW_LOCK_BIAS);
@@ -107,4 +107,6 @@ void user_main()
 
        thrd_join(t1);
        thrd_join(t2);
+
+       return 0;
 }