diff src/parallel_execution/context.h @ 230:a1fb3f2d1a36

fix worker
author ikkun
date Sat, 21 Jan 2017 20:21:00 +0900
parents 77faa28128b4
children 123b0d277b84
line wrap: on
line diff
--- a/src/parallel_execution/context.h	Sat Jan 21 20:04:32 2017 +0900
+++ b/src/parallel_execution/context.h	Sat Jan 21 20:21:00 2017 +0900
@@ -49,6 +49,8 @@
 
 struct Context {
     enum Code next;
+    struct Worker* worker;
+    struct TaskManager* taskManager;
     int codeNum;
     __code (**code) (struct Context*);
     void* heapStart;
@@ -65,6 +67,7 @@
         enum DataType type;
         struct Queue* wait; // tasks waiting this dataGear
     } meta;
+    struct Context context;
     struct Time {
         enum Code next;
         double time;
@@ -89,12 +92,12 @@
     } TaskManagerImpl;
     struct Worker {
         int id;
-        struct Context* contexts;
-        enum Code execute;
-        enum Code taskSend;
+        struct Queue* tasks;
+        int runFlag;
+        struct Context* context;
         enum Code taskReceive;
         enum Code shutdown;
-        struct Queue* tasks;
+        enum Code next;
     } Worker;
 #ifdef USE_CUDA
     struct CudaTask {