ms-queue: don't initialize node 0
authorBrian Norris <banorris@uci.edu>
Fri, 8 Mar 2013 23:07:50 +0000 (15:07 -0800)
committerBrian Norris <banorris@uci.edu>
Fri, 8 Mar 2013 23:07:50 +0000 (15:07 -0800)
Node zero *should* be unused, since "0" is the NULL pointer index.
Removing this init will help catch bugs.

ms-queue/my_queue.c

index d658407..8a74060 100644 (file)
@@ -31,9 +31,6 @@ void init_queue(queue_t *q, int num_threads)
        for (i = 0; i < num_threads; i++)
                node_nums[i] = 2 + i;
 
-       /* Note: needed to add this init manually */
-       atomic_init(&q->nodes[0].next, 0);
-
        /* initialize queue */
        head = MAKE_POINTER(1, 0);
        tail = MAKE_POINTER(1, 0);