diff src/parallel_execution/CPUWorker.cbc @ 411:0eba9a04633f

Work CUDAtwice
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Thu, 14 Sep 2017 18:26:52 +0900
parents 85b0ddbf458e
children 55db2a339958
line wrap: on
line diff
--- a/src/parallel_execution/CPUWorker.cbc	Thu Sep 14 02:35:20 2017 +0900
+++ b/src/parallel_execution/CPUWorker.cbc	Thu Sep 14 18:26:52 2017 +0900
@@ -10,7 +10,7 @@
     cpuWorker->id = id;
     worker->taskReceive = C_taskReceiveWorker;
     worker->shutdown = C_shutdownWorker;
-    pthread_create(&worker->worker->CPUWorker.thread, NULL, (void*)&startWorker, worker);
+    pthread_create(&worker->thread, NULL, (void*)&startWorker, worker);
     return worker;
 }
 
@@ -34,7 +34,7 @@
 
 __code getTask(struct Worker* worker, struct Context* task) {
     if (!task)
-        return; // end thread
+        goto meta(context, worker->shutdown); // end thread
     task->worker = worker;
     enum Code taskCg = task->next;
     if (task->iterate) {