typo
[model-checker-benchmarks.git] / seqlock / testcase1.cc
1 #include <threads.h>
2 #include "seqlock.h"
3
4 seqlock *lock;
5
6 static void a(void *obj) {
7         write(lock, 1, 2);
8 }
9
10 static void b(void *obj) {
11         write(lock, 3, 4);
12 }
13
14 static void c(void *obj) {
15         int *data1 = new int;
16         int *data2 = new int;
17         read(lock, data1, data2);
18 }
19
20 int user_main(int argc, char **argv) {
21         thrd_t t1, t2, t3;
22         /** @Entry */
23         lock = new seqlock;
24
25         thrd_create(&t1, (thrd_start_t)&a, NULL);
26         //thrd_create(&t2, (thrd_start_t)&b, NULL);
27         thrd_create(&t3, (thrd_start_t)&c, NULL);
28
29         thrd_join(t1);
30         //thrd_join(t2);
31         thrd_join(t3);
32         return 0;
33 }