Mercurial > hg > Members > Moririn
diff src/parallel_execution/worker.c @ 244:d1567718f12c
Fix error
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 25 Jan 2017 01:48:47 +0900 |
parents | 9f3f8ed6ed9f |
children | ce262b2c1daf |
line wrap: on
line diff
--- a/src/parallel_execution/worker.c Tue Jan 24 18:39:42 2017 +0900 +++ b/src/parallel_execution/worker.c Wed Jan 25 01:48:47 2017 +0900 @@ -9,7 +9,7 @@ struct Worker* worker = ALLOC(context, Worker); struct CPUWorker* cpuWorker = ALLOC(context, CPUWorker); worker->worker = (union Data*)cpuWorker; - cpuWorker->tasks = queue; + worker->tasks = queue; cpuWorker->id = id; worker->taskReceive = C_taskReceiveWorker; worker->shutdown = C_shutdownWorker; @@ -25,15 +25,14 @@ goto meta(cpuWorker->context, C_taskReceiveWorker); } -__code taskReceiveWorker(struct Context* context, CPUWorker* worker) { +__code taskReceiveWorker(struct Context* context, Worker* worker) { Queue* queue = worker->tasks; queue->next = C_getTask1; goto meta(context, queue->take); } __code taskReceiveWorker_stub(struct Context* context) { - CPUWorker* worker = (CPUWorker *)GearImpl(context, Worker, worker); - goto taskReceiveWorker(context,worker); + goto taskReceiveWorker(context, Gearef(context, Worker)); } __code getTask1(struct Context* context, Worker* worker, struct Context* task) { @@ -45,8 +44,7 @@ __code getTask1_stub(struct Context* context) { Worker* worker = Gearef(context,Worker); - CPUWorker* cpuWorker = (CPUWorker *)GearImpl(context, Worker, worker); - Context* task = &cpuWorker->tasks->data->context; + Context* task = &worker->tasks->data->context; goto getTask1(context,worker,task); }