diff src/parallel_execution/worker.c @ 109:059b26a250cc

Change put_queue process
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Mon, 02 May 2016 20:02:09 +0900
parents 6402a33250a6
children d05b9937aa95
line wrap: on
line diff
--- a/src/parallel_execution/worker.c	Mon Apr 11 01:45:22 2016 +0900
+++ b/src/parallel_execution/worker.c	Mon May 02 20:02:09 2016 +0900
@@ -8,18 +8,17 @@
         return;
 
     struct Element* first = queue->first;
-//    if (__sync_bool_compare_and_swap(&queue->first, first, first->next)) {
-    if (OSAtomicCompareAndSwapPtr(first, first->next, (void*)&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;
 
-	struct Traverse *t = &context->data[Traverse]->traverse;
-	t->next = GetQueue;
+        struct Traverse *t = &context->data[Traverse]->traverse;
+        t->next = GetQueue;
         goto meta(context, Get);
     } else {
         goto meta(context, GetQueue);