#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
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);
}
}
-void user_main()
+int user_main(int argc, char **argv)
{
thrd_t t1, t2;
atomic_init(&mylock.lock, RW_LOCK_BIAS);
thrd_join(t1);
thrd_join(t2);
+
+ return 0;
}