From: Brian Demsky Date: Thu, 7 Mar 2013 03:33:14 +0000 (-0800) Subject: do merge...push right code X-Git-Tag: oopsla2013-final~27^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=391f44d47dad3cf21f18a858504b902ec48fe032;hp=-c;p=model-checker-benchmarks.git do merge...push right code Merge branch 'master' of ssh://demsky.eecs.uci.edu/home/git/model-checker-benchmarks Conflicts: chase-lev-deque/main.c --- 391f44d47dad3cf21f18a858504b902ec48fe032 diff --combined chase-lev-deque/main.c index 0a29a51,c744b47..424806f --- a/chase-lev-deque/main.c +++ b/chase-lev-deque/main.c @@@ -3,16 -3,20 +3,19 @@@ #include #include #include + #include + + #include "model-assert.h" #include "deque.h" Deque *q; int a; int b; +int c; static void task(void * param) { - do { - a=steal(q); - } while(a==EMPTY); + a=steal(q); } int user_main(int argc, char **argv) @@@ -22,20 -26,11 +25,22 @@@ thrd_create(&t, task, 0); push(q, 1); push(q, 2); + push(q, 4); b=take(q); + c=take(q); thrd_join(t); + - printf("a=%d b=%d\n",a,b); - MODEL_ASSERT(a + b == 3); + 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; }