X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker-benchmarks.git;a=blobdiff_plain;f=chase-lev-deque%2Fmain.c;h=c744b47020c25872f7fb4947cdff32cd1cb5cc75;hp=77ea5a850451d06c9e66eb627ade7ab4dd0e6946;hb=ad2809cd62aeacf73e1bd4e5f57ef02b913190a5;hpb=510a66b137541be02613138e522213cdc4b9e9d5 diff --git a/chase-lev-deque/main.c b/chase-lev-deque/main.c index 77ea5a8..c744b47 100644 --- a/chase-lev-deque/main.c +++ b/chase-lev-deque/main.c @@ -3,6 +3,9 @@ #include #include #include +#include + +#include "model-assert.h" #include "deque.h" @@ -11,7 +14,9 @@ int a; int b; static void task(void * param) { - a=steal(q); + do { + a=steal(q); + } while(a==EMPTY); } int user_main(int argc, char **argv) @@ -21,11 +26,11 @@ int user_main(int argc, char **argv) thrd_create(&t, task, 0); push(q, 1); push(q, 2); - do { - b=take(q); - } while(b==EMPTY); + b=take(q); thrd_join(t); - if (a+b!=3) - printf("a=%d b=%d\n",a,b); + + printf("a=%d b=%d\n",a,b); + MODEL_ASSERT(a + b == 3); + return 0; }