64d044450a93c5bccee63243ef5b279b6f622ea0
[model-checker-benchmarks.git] / chase-lev-deque / main.c
1 #include <stdlib.h>
2 #include <assert.h>
3 #include <stdio.h>
4 #include <threads.h>
5 #include <stdatomic.h>
6
7 #include "deque.h"
8
9 Deque *q;
10 int a;
11 int b;
12
13 static void task(void * param) {
14         a=steal(q);
15 }
16
17 int user_main(int argc, char **argv)
18 {
19         thrd_t t;
20         q=create();
21         thrd_create(&t, task, 0);
22         push(q, 1);
23         push(q, 2);
24         b=take(q);
25         thrd_join(t);
26         if (a+b!=3)
27                 printf("a=%d b=%d\n",a,b);
28         return 0;
29 }