X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker-benchmarks.git;a=blobdiff_plain;f=chase-lev-deque%2Fmain.c;h=0a29a51572551004ca40b3a8c28551e9e161c62d;hp=64d044450a93c5bccee63243ef5b279b6f622ea0;hb=037b00400699b8bd88b250d6d5b053a85edb2a61;hpb=b2f7bb95913baa71483d088402a32d5ca64b56f7 diff --git a/chase-lev-deque/main.c b/chase-lev-deque/main.c index 64d0444..0a29a51 100644 --- a/chase-lev-deque/main.c +++ b/chase-lev-deque/main.c @@ -9,6 +9,7 @@ Deque *q; int a; int b; +int c; static void task(void * param) { a=steal(q); @@ -21,9 +22,20 @@ int user_main(int argc, char **argv) thrd_create(&t, task, 0); push(q, 1); push(q, 2); + push(q, 4); b=take(q); + c=take(q); thrd_join(t); - if (a+b!=3) - printf("a=%d b=%d\n",a,b); + bool correct=true; + if (a!=1 && a!=2 && a!=4 && a!= EMPTY) + correct=false; + if (b!=1 && b!=2 && b!=4 && b!= EMPTY) + correct=false; + if (c!=1 && c!=2 && c!=4 && a!= EMPTY) + correct=false; + if (a!=EMPTY && b!=EMPTY && c!=EMPTY && (a+b+c)!=7) + correct=false; + if (!correct) + printf("a=%d b=%d c=%d\n",a,b,c); return 0; }