# HG changeset patch # User Tatsuki IHA # Date 1485243856 -32400 # Node ID 9135e22799ddb381f207a119171a1902af869632 # Parent 864bb372f37f59de28dff9768066457925be12bd# Parent cc13a16083644336926b858f54a7d19a5b4ac673 Merge diff -r 864bb372f37f -r 9135e22799dd src/parallel_execution/context.h --- 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; diff -r 864bb372f37f -r 9135e22799dd src/parallel_execution/taskManager.c --- 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;