#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;
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");
}
}