need to fix deque
[cdsspec-compiler.git] / benchmark / chase-lev-deque-bugfix / main.c
index a67be6efad20e8f81fdf029c1ffe13e8e363a29c..7fb831f3d55d08568ba8db5a986146f173e1de21 100644 (file)
@@ -13,12 +13,11 @@ int a;
 int b;
 int c;
 
-static void task1(void * param) {
-       a=steal(q);
-}
+static void task(void * param) {
+       // FIXME: Add the following take() will expose an Uninitialzied Load bug...
+       //a=take(q);
 
-static void task2(void * param) {
-       a=take(q);
+       a=steal(q);
 }
 
 int user_main(int argc, char **argv)
@@ -28,17 +27,15 @@ int user_main(int argc, char **argv)
                @Entry_point
                @End
        */
-       thrd_t t1, t2;
+       thrd_t t;
        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(t1);
-       thrd_join(t2);
+       thrd_join(t);
 
        bool correct=true;
        if (a!=1 && a!=2 && a!=4 && a!= EMPTY)
@@ -51,7 +48,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;
 }