Commit 14ff108b authored by Scott Vokes's avatar Scott Vokes
Browse files

Close race condition in pop.

parent 19312d8c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ void *casq_pop(struct casq *q) {
            l->data = NULL;
            for (;;) {              /* spin, push */
                l->next = q->free_links;
                if (ATOMIC_BOOL_COMPARE_AND_SWAP(&q->free_links, q->free_links, l)) {
                if (ATOMIC_BOOL_COMPARE_AND_SWAP(&q->free_links, l->next, l)) {
                    break;
                }
            }