diff src/parallel_execution/worker.c @ 235:05e61405cc88

fix worker compile error
author mir3636
date Mon, 23 Jan 2017 17:49:36 +0900
parents 06133afb3b5b
children 865179a0a56d
line wrap: on
line diff
--- a/src/parallel_execution/worker.c	Sun Jan 22 20:17:11 2017 +0900
+++ b/src/parallel_execution/worker.c	Mon Jan 23 17:49:36 2017 +0900
@@ -3,7 +3,7 @@
 #include "context.h"
 #include "origin_cs.h"
 
-static void start_code(Worker* worker);
+static void start_worker(Worker* worker);
 
 union Data* createCPUWorker(struct Context* context, int id, Queue* queue, enum Code next) {
     struct Worker* worker = ALLOC(context, Worker);
@@ -15,15 +15,15 @@
     cpuWorker->next = next;
     worker->taskReceive = C_taskReceiveWorker;
     worker->shutdown = C_shutdownWorker;
-    pthread_create(&worker->thread, NULL, (void*)&start_code, worker);
+    pthread_create(&worker->worker->CPUWorker.thread, NULL, (void*)&start_worker, worker);
     return (union Data*)(worker);
 }
 
-static void start_code(Worker* worker) {
-    CPUWorker* worker = (CPUWorker*)worker->worker;
-    worker->context = NEW(struct Context);
-    initContext(worker->context);
-    goto meta(worker->context, C_taskReceiveWorker);
+static void start_worker(Worker* worker) {
+    CPUWorker* cpuWorker = (CPUWorker*)worker->worker;
+    cpuWorker->context = NEW(struct Context);
+    initContext(cpuWorker->context);
+    goto meta(cpuWorker->context, C_taskReceiveWorker);
 }
 
 __code taskReceiveWorker(struct Context* context, CPUWorker* worker) {