From: Peizhao Ou Date: Thu, 15 Jan 2015 01:59:08 +0000 (-0800) Subject: changes X-Git-Url: http://plrg.eecs.uci.edu/git/?p=cdsspec-compiler.git;a=commitdiff_plain;h=610f6861b80e1fc2f258338a7f4bc996ef194fd4 changes --- diff --git a/benchmark/ms-queue/my_queue.c b/benchmark/ms-queue/my_queue.c index fe4da51..f59d777 100644 --- a/benchmark/ms-queue/my_queue.c +++ b/benchmark/ms-queue/my_queue.c @@ -63,6 +63,9 @@ static void reclaim(unsigned int node) void init_queue(queue_t *q, int num_threads) { int i, j; + for (i = 0; i < MAX_NODES; i++) { + atomic_init(&q->nodes[i].next, MAKE_POINTER(POISON_IDX, 0)); + } /* Initialize each thread's free list with INITIAL_FREE pointers */ /* The actual nodes are initialized with poison indexes */ @@ -191,11 +194,11 @@ bool dequeue(queue_t *q, int *retVal) @Label: Dequeue_Read_Head @End */ - /** A new bug has been found here!!! It should be acquire instead of + /** FIXME: A new bug has been found here!!! It should be acquire instead of * relaxed (it introduces a bug when there's two dequeuers and one * enqueuer) */ - tail = atomic_load_explicit(&q->tail, acquire); + tail = atomic_load_explicit(&q->tail, relaxed); /** @Begin @Potential_commit_point_define: true