X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=benchmark%2Fchase-lev-deque-bugfix%2Fmain.c;fp=benchmark%2Fchase-lev-deque-bugfix%2Fmain.c;h=a67be6efad20e8f81fdf029c1ffe13e8e363a29c;hb=7a77931bb0107ba11c874485309c9f38f5bec967;hp=481f3da59994833291cbf8b1e181b604ebc2e9a3;hpb=f4f705b64671cdfae4d4cf8997e64a81ddce201d;p=cdsspec-compiler.git diff --git a/benchmark/chase-lev-deque-bugfix/main.c b/benchmark/chase-lev-deque-bugfix/main.c index 481f3da..a67be6e 100644 --- a/benchmark/chase-lev-deque-bugfix/main.c +++ b/benchmark/chase-lev-deque-bugfix/main.c @@ -13,10 +13,14 @@ int a; int b; int c; -static void task(void * param) { +static void task1(void * param) { a=steal(q); } +static void task2(void * param) { + a=take(q); +} + int user_main(int argc, char **argv) { /** @@ -24,15 +28,17 @@ int user_main(int argc, char **argv) @Entry_point @End */ - thrd_t t; + thrd_t t1, t2; q=create(); - thrd_create(&t, task, 0); push(q, 1); push(q, 2); + thrd_create(&t1, task1, 0); + thrd_create(&t2, task2, 0); push(q, 4); b=take(q); c=take(q); - thrd_join(t); + thrd_join(t1); + thrd_join(t2); bool correct=true; if (a!=1 && a!=2 && a!=4 && a!= EMPTY) @@ -45,7 +51,7 @@ int user_main(int argc, char **argv) correct=false; if (!correct) printf("a=%d b=%d c=%d\n",a,b,c); - MODEL_ASSERT(correct); + //MODEL_ASSERT(correct); return 0; }