Mercurial > hg > Gears > GearsAgda
comparison src/parallel_execution/CPUWorker.cbc @ 405:8915fce522b3
Fix shutdown TaskManager
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 05 Sep 2017 16:46:31 +0900 |
parents | ad44fdb11433 |
children | 85b0ddbf458e |
comparison
equal
deleted
inserted
replaced
404:c5cd9888bf2a | 405:8915fce522b3 |
---|---|
66 __code iterateCommit1_stub(struct Context* context) { | 66 __code iterateCommit1_stub(struct Context* context) { |
67 struct Context* workerContext = context->worker->worker->CPUWorker.context; | 67 struct Context* workerContext = context->worker->worker->CPUWorker.context; |
68 goto iterateCommit1(workerContext, context); | 68 goto iterateCommit1(workerContext, context); |
69 } | 69 } |
70 | 70 |
71 __code odgCommit(struct LoopCounter* loopCounter, struct Context* task) { | 71 __code odgCommit(struct LoopCounter* loopCounter, struct Context* task, struct TaskManager* taskManager) { |
72 int i = loopCounter->i ; | 72 int i = loopCounter->i ; |
73 if (task->odg+i < task->maxOdg) { | 73 if (task->odg+i < task->maxOdg) { |
74 goto meta(task, C_odgCommit1); | 74 goto meta(task, C_odgCommit1); |
75 } | 75 } |
76 loopCounter->i = 0; | 76 loopCounter->i = 0; |
77 goto meta(context, C_taskReceiveWorker); | 77 taskManager->taskManager = (union Data*)task->taskManager; |
78 taskManager->next = C_taskReceiveWorker; | |
79 goto meta(context, task->taskManager->decrementTaskCount); | |
78 } | 80 } |
79 | 81 |
80 __code odgCommit_stub(struct Context* context) { | 82 __code odgCommit_stub(struct Context* context) { |
81 struct Context* workerContext = context->worker->worker->CPUWorker.context; | 83 struct Context* workerContext = context->worker->worker->CPUWorker.context; |
82 goto odgCommit(workerContext, | 84 goto odgCommit(workerContext, |
83 Gearef(context, LoopCounter), | 85 Gearef(context, LoopCounter), |
84 context); | 86 context, |
87 Gearef(workerContext, TaskManager)); | |
85 } | 88 } |
86 | 89 |
87 __code odgCommit1(struct LoopCounter* loopCounter, struct Queue* queue) { | 90 __code odgCommit1(struct LoopCounter* loopCounter, struct Queue* queue) { |
88 int i = loopCounter->i ; | 91 int i = loopCounter->i ; |
89 queue->queue = (union Data*)GET_WAIT_LIST(context->data[context->odg+i]); | 92 queue->queue = (union Data*)GET_WAIT_LIST(context->data[context->odg+i]); |