annotate src/parallel_execution/TaskManagerImpl.cbc @ 348:c03159481cb6

Par goto exchange inline expansion
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Tue, 06 Jun 2017 17:08:55 +0900
parents 534601ed8c50
children 01e0fa598ce3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
1 #include "../context.h"
278
23767f714f4a fix generate_stub
mir3636
parents: 277
diff changeset
2
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
3 #include <stdio.h>
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
4
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
5 void createWorkers(struct Context* context, TaskManager* taskManeger, TaskManagerImpl* taskManagerImpl);
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
6
280
2c2e4e597eb0 generate no compile errors
mir3636
parents: 279
diff changeset
7 TaskManager* createTaskManagerImpl(struct Context* context, int numCPU, int numGPU, int numIO) {
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
8 struct TaskManager* taskManager = new TaskManager();
326
f23f6d0aa4e9 Add examples/calc.cbc and build but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 319
diff changeset
9 // 0...numIO-1 IOProcessor
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
10 // numIO...numIO+numGPU-1 GPUProcessor
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
11 // numIO+numGPU...numIO+numGPU+numCPU-1 CPUProcessor
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
12 taskManager->io = 0;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
13 taskManager->gpu = numIO;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
14 taskManager->cpu = numIO+numGPU;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
15 taskManager->maxCPU = numIO+numGPU+numCPU;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
16 taskManager->createTask = C_createTask;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
17 taskManager->spawn = C_spawnTaskManager;
326
f23f6d0aa4e9 Add examples/calc.cbc and build but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 319
diff changeset
18 taskManager->setWaitTask = C_setWaitTask;
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
19 taskManager->shutdown = C_shutdownTaskManager;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
20 struct TaskManagerImpl* taskManagerImpl = new TaskManagerImpl();
280
2c2e4e597eb0 generate no compile errors
mir3636
parents: 279
diff changeset
21 taskManagerImpl -> activeQueue = createSingleLinkedQueue(context);
2c2e4e597eb0 generate no compile errors
mir3636
parents: 279
diff changeset
22 taskManagerImpl -> taskQueue = createSingleLinkedQueue(context);
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
23 taskManagerImpl -> numWorker = taskManager->maxCPU;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
24 createWorkers(context, taskManager, taskManagerImpl);
316
54d203daf06b CUDAtwice.cbc is called.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 312
diff changeset
25 taskManager->taskManager = (union Data*)taskManagerImpl;
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
26 return taskManager;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
27 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
28
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
29 void createWorkers(struct Context* context, TaskManager* taskManager, TaskManagerImpl* taskManagerImpl) {
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
30 int i = 0;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
31 taskManagerImpl->workers = (Worker**)ALLOC_ARRAY(context, Worker, taskManager->maxCPU);
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
32 for (;i<taskManager->gpu;i++) {
280
2c2e4e597eb0 generate no compile errors
mir3636
parents: 279
diff changeset
33 Queue* queue = createSynchronizedQueue(context);
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
34 taskManagerImpl->workers[i] = (Worker*)createCPUWorker(context, i, queue);
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
35 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
36 for (;i<taskManager->cpu;i++) {
312
7dd5a7d52a67 USE_CUDAWorker flag only for CUDAtwice
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 288
diff changeset
37 #ifdef USE_CUDAWorker
7dd5a7d52a67 USE_CUDAWorker flag only for CUDAtwice
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 288
diff changeset
38 Queue* queue = createSynchronizedQueue(context);
319
a15511b1a6e0 separate cuda.c, and USE_CUDA_MAIN_THREAD flag
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 317
diff changeset
39 #ifndef USE_CUDA_MAIN_THREAD
a15511b1a6e0 separate cuda.c, and USE_CUDA_MAIN_THREAD flag
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 317
diff changeset
40 taskManagerImpl->workers[i] = (Worker*)createCUDAWorker(context, i, queue,0);
a15511b1a6e0 separate cuda.c, and USE_CUDA_MAIN_THREAD flag
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 317
diff changeset
41 #else
316
54d203daf06b CUDAtwice.cbc is called.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 312
diff changeset
42 taskManagerImpl->workers[i] = (Worker*)queue;
319
a15511b1a6e0 separate cuda.c, and USE_CUDA_MAIN_THREAD flag
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 317
diff changeset
43 #endif
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
44 #else
280
2c2e4e597eb0 generate no compile errors
mir3636
parents: 279
diff changeset
45 Queue* queue = createSynchronizedQueue(context);
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
46 taskManagerImpl->workers[i] = (Worker*)createCPUWorker(context, i, queue);
326
f23f6d0aa4e9 Add examples/calc.cbc and build but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 319
diff changeset
47 #endif
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
48 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
49 for (;i<taskManager->maxCPU;i++) {
280
2c2e4e597eb0 generate no compile errors
mir3636
parents: 279
diff changeset
50 Queue* queue = createSynchronizedQueue(context);
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
51 taskManagerImpl->workers[i] = (Worker*)createCPUWorker(context, i, queue);
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
52 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
53 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
54
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
55 __code createTask(struct TaskManager* taskManager) {
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
56 taskManager->context = NEW(struct Context);
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
57 initContext(taskManager->context);
327
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
58 taskManager->context->taskManager = (struct TaskManager*)taskManager->taskManager;
326
f23f6d0aa4e9 Add examples/calc.cbc and build but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 319
diff changeset
59 taskManager->context->idg = taskManager->context->dataNum;
280
2c2e4e597eb0 generate no compile errors
mir3636
parents: 279
diff changeset
60 goto meta(context, C_setWorker);
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
61 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
62
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
63 __code setWorker(struct TaskManagerImpl* taskManager, struct Context* task, __code next(...)) {
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
64 task->workerId = taskManager->sendWorkerIndex;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
65 if(++taskManager->sendWorkerIndex >= taskManager->numWorker) {
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
66 taskManager->sendWorkerIndex = 0;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
67 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
68 goto next(...);
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
69 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
70
280
2c2e4e597eb0 generate no compile errors
mir3636
parents: 279
diff changeset
71 __code setWorker_stub(struct Context* context) {
2c2e4e597eb0 generate no compile errors
mir3636
parents: 279
diff changeset
72 TaskManagerImpl* taskManager = (TaskManagerImpl*)GearImpl(context, TaskManager, taskManager);
2c2e4e597eb0 generate no compile errors
mir3636
parents: 279
diff changeset
73 goto setWorker(context, taskManager, Gearef(context, TaskManager)->context, Gearef(context, TaskManager)->next);
2c2e4e597eb0 generate no compile errors
mir3636
parents: 279
diff changeset
74 }
2c2e4e597eb0 generate no compile errors
mir3636
parents: 279
diff changeset
75
348
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
76 __code setWaitTask(struct TaskManager* taskManager, struct Queue* queue, struct Context* task, struct LoopCounter* loopCounter, __code next(...)) {
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
77 int i = loopCounter->i;
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
78 if(task->idg + i < task->maxidg) {
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
79 loopCounter->i++;
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
80 queue->queue = (Data *)GET_WAIT_LIST(task->data[task->idg + i]);
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
81 queue->next = C_setWaitTask;
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
82 queue->data = (Data *)task;
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
83 goto meta(context, queue->queue->Queue.put);
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
84 }
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
85 goto meta(context, taskManager->taskManager->spawn);
327
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
86 }
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
87
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
88 __code setWaitTask_stub(struct Context* context) {
348
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
89 TaskManager* taskManager = Gearef(context, TaskManager);
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
90 struct Context* task = Gearef(context, TaskManager)->context;
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
91 goto setWaitTask(context, taskManager, Gearef(context, Queue), task, Gearef(task, LoopCounter), taskGearef(context, TaskManager)->next);
327
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
92 }
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
93
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
94 __code spawnTaskManager(struct TaskManagerImpl* taskManager, struct Queue* queue, struct Context* task, __code next(...)) {
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
95 if (task->idgCount == 0) {
327
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
96 goto meta(context, C_taskSend);
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
97 } else {
327
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
98 pthread_mutex_unlock(&taskManager->mutex);
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
99 goto next(...);
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
100 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
101 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
102
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
103 __code spawnTaskManager_stub(struct Context* context) {
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
104 TaskManagerImpl* taskManager = (TaskManagerImpl*)GearImpl(context, TaskManager, taskManager);
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
105 pthread_mutex_lock(&taskManager->mutex);
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
106 goto spawnTaskManager(context,
348
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
107 taskManager,
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
108 Gearef(context, Queue),
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
109 Gearef(context, TaskManager)->context,
c03159481cb6 Par goto exchange inline expansion
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 327
diff changeset
110 Gearef(context, TaskManager)->next);
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
111 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
112
327
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
113 __code taskSend(struct TaskManagerImpl* taskManager, struct Queue* queue, struct Context* task, __code next(...)) {
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
114 struct Queue* tasks = taskManager->workers[task->workerId]->tasks;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
115 queue->queue = (union Data*)tasks;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
116 queue->data = (union Data*)task;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
117 queue->next = next;
327
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
118 pthread_mutex_unlock(&taskManager->mutex);
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
119 goto meta(context, tasks->put);
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
120 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
121
327
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
122 __code taskSend_stub(struct Context* context) {
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
123 TaskManagerImpl* taskManager = (TaskManagerImpl*)GearImpl(context, TaskManager, taskManager);
327
534601ed8c50 Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 326
diff changeset
124 goto taskSend(context, taskManager, Gearef(context, Queue), Gearef(context, TaskManager)->context, Gearef(context, TaskManager)->next);
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
125 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
126
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
127 __code shutdownTaskManager(struct LoopCounter* loopCounter, struct TaskManager* taskManager, struct TaskManagerImpl* taskManagerImpl, struct Queue* queue, __code next(...)) {
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
128 int i = loopCounter->i;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
129 if (taskManager->cpu <= i && i < taskManager->maxCPU) {
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
130 struct Queue* tasks = taskManagerImpl->workers[i]->tasks;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
131 queue->queue = (union Data*)tasks;
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
132 queue->data = NULL;
282
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
133 queue->next = C_shutdownTaskManager1;
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
134 goto meta(context, tasks->put);
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
135 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
136
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
137 loopCounter->i = 0;
282
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
138 goto meta(context, next);
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
139 }
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
140
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
141 __code shutdownTaskManager_stub(struct Context* context) {
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
142 TaskManagerImpl* taskManagerImpl = (TaskManagerImpl*)GearImpl(context, TaskManager, taskManager);
282
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
143 goto shutdownTaskManager(context, Gearef(context, LoopCounter), &Gearef(context, TaskManager)->taskManager->TaskManager, taskManagerImpl, Gearef(context, Queue), Gearef(context, TaskManager)->next);
269
5170539348ec rename TaskManagerImpl.cbc
mir3636
parents:
diff changeset
144 }
282
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
145
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
146 __code shutdownTaskManager1(struct LoopCounter* loopCounter, TaskManagerImpl* taskManagerImpl) {
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
147 int i = loopCounter->i;
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
148 pthread_join(taskManagerImpl->workers[i]->worker->CPUWorker.thread, NULL);
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
149 loopCounter->i++;
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
150 goto meta(context, C_shutdownTaskManager);
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
151 }
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
152
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
153 __code shutdownTaskManager1_stub(struct Context* context) {
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
154 TaskManagerImpl* taskManagerImpl = (TaskManagerImpl*)GearImpl(context, TaskManager, taskManager);
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
155 goto shutdownTaskManager1(context, Gearef(context, LoopCounter), taskManagerImpl);
a3448b0f0a56 Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents: 280
diff changeset
156 }