edits
[cdsspec-compiler.git] / benchmark / ms-queue / testcase3.c
index 8ab6dbfca0d8126aadd3d01fd9728c37750f053a..526593cf6a052f78006241cba04d5ed73ef510b0 100644 (file)
@@ -5,7 +5,7 @@
 #include "my_queue.h"
 #include "model-assert.h"
 
-static int procs = 2;
+static int procs = 3;
 static queue_t *queue;
 static thrd_t *threads;
 static unsigned int *input;
@@ -39,13 +39,17 @@ static void main_task(void *param)
                else
                        printf("Thrd 1: Dequeue NULL.\n");
        } else if (pid % 4 == 1) {
-               enqueue(queue, 2);
-               output2 = 1;
-               succ2 = dequeue(queue, &output2);
-               if (succ2)
-                       printf("Thrd 2: Dequeue %d.\n", output2);
+               enqueue(queue, 1);
+               printf("Thrd 2: Enqueue %d.\n", 1);
+       } else if (pid % 4 == 2) {
+               //enqueue(queue, 2);
+
+               output1 = 1;
+               succ1 = dequeue(queue, &output1);
+               if (succ1)
+                       printf("Thrd 3: Dequeue %d.\n", output1);
                else
-                       printf("Thrd 2: Dequeue NULL.\n");
+                       printf("Thrd 3: Dequeue NULL.\n");
        }
 }