Mercurial > hg > Papers > 2016 > parusu-sigos
view paper/src/sync_dequeue.c @ 16:f88786cba8b5
Update
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 29 May 2016 16:34:28 +0900 |
parents | 7355dbef5b75 |
children |
line wrap: on
line source
// Dequeue __code getQueue(struct Context* context, struct Queue* queue, struct Node* node) { if (queue->first == 0) return; struct Element* first = queue->first; if (__sync_bool_compare_and_swap(&queue->first, first, first->next)) { queue->count--; context->next = GetQueue; stack_push(context->code_stack, &context->next); context->next = first->task->code; node->key = first->task->key; goto meta(context, Get); } else { goto meta(context, GetQueue); } }