# HG changeset patch # User mir3636 # Date 1481790698 -32400 # Node ID dec50dd624c700f0416ebae37299e822532279d2 # Parent 57a11c15ff4c92adee2b81691f40bcc77bb6f612 fix diff -r 57a11c15ff4c -r dec50dd624c7 src/parallel_execution/context.h --- a/src/parallel_execution/context.h Wed Dec 14 21:33:11 2016 +0900 +++ b/src/parallel_execution/context.h Thu Dec 15 17:31:38 2016 +0900 @@ -180,7 +180,6 @@ struct TaskManager { int numWorker; enum Code spawn; - enum Code taskSend; enum Code shutdown; struct Worker* workers; } taskManager; diff -r 57a11c15ff4c -r dec50dd624c7 src/parallel_execution/twice.c --- a/src/parallel_execution/twice.c Wed Dec 14 21:33:11 2016 +0900 +++ b/src/parallel_execution/twice.c Thu Dec 15 17:31:38 2016 +0900 @@ -3,6 +3,10 @@ #include "context.h" #include "origin_cs.h" +struct LoopCounter { + int i; +} loopCounter; + __code twice(struct Context* context, struct LoopCounter* loopCounter, int index, int prefix, int* array) { int i = loopCounter->i; diff -r 57a11c15ff4c -r dec50dd624c7 src/parallel_execution/worker.c --- a/src/parallel_execution/worker.c Wed Dec 14 21:33:11 2016 +0900 +++ b/src/parallel_execution/worker.c Thu Dec 15 17:31:38 2016 +0900 @@ -3,6 +3,16 @@ #include "context.h" #include "origin_cs.h" +union Data* createWorker(struct Context* context) { + struct Worker* worker = &ALLOCATE(context, Worker)->Worker; + struct Queue* tasks = &ALLOCATE(context, Queue)->Queue; + worker->execute = C_executeWorker; + worker->taskSend = C_taskSendWorker; + worker->taskRecive = C_taskReciveWorker; + worker->shutdown = C_shutdownWorker; + return (union Data*)(worker); +} + __code getTask1(struct Context* context, struct Queue* queue) { queue->next = C_getTask2; goto meta(context, queue->take);