Mercurial > hg > GearsTemplate
changeset 241:9135e22799dd
Merge
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 24 Jan 2017 16:44:16 +0900 |
parents | 864bb372f37f (current diff) cc13a1608364 (diff) |
children | 9f3f8ed6ed9f |
files | src/parallel_execution/taskManager.c |
diffstat | 2 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/context.h Tue Jan 24 16:31:10 2017 +0900 +++ b/src/parallel_execution/context.h Tue Jan 24 16:44:16 2017 +0900 @@ -111,6 +111,7 @@ } TaskManager; struct TaskManagerImpl { int numWorker; + pthread_mutex_t mutex; struct Queue* activeQueue; struct Queue* taskQueue; struct Worker* workers;
--- a/src/parallel_execution/taskManager.c Tue Jan 24 16:31:10 2017 +0900 +++ b/src/parallel_execution/taskManager.c Tue Jan 24 16:44:16 2017 +0900 @@ -72,9 +72,10 @@ } __code spawnTaskManager_stub(struct Context* context) { - pthread_mutex_lock(taskManager->mutex); + TaskManagerImpl* taskManager = (TaskManagerImpl*)GearImpl(context, TaskManager, taskManager); + pthread_mutex_lock(&taskManager->mutex); goto spawnTaskManager(context, - (struct TaskManager*)GearImpl(context, TaskManager, taskManager), + taskManager, Gearef(context, Queue), Gearef(context, TaskManager)->context, Gearef(context, TaskManager)->next); @@ -102,6 +103,10 @@ goto meta(context, TaskManager->next); } +__code taskSend_stub(struct Context* context) { + goto taskSend(context, (TaskManagerImpl*)GearImpl(context, TaskManager, taskManager)); +} + __code createWorker1(struct Context* context, struct LoopCounter* loopCounter, struct Worker* worker) { int i = loopCounter->i;