comparison src/parallel_execution/dependency.c @ 148:473b7d990a1f

fix data gears type enum
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 10 Nov 2016 12:07:53 +0900
parents d05b9937aa95
children ea7b11f3e717
comparison
equal deleted inserted replaced
147:f2275f5777f4 148:473b7d990a1f
1 #include <stdio.h> 1 #include <stdio.h>
2 #include "context.h" 2 #include "context.h"
3 #include "origin_cs.h" 3 #include "origin_cs.h"
4 4
5 __code meta_waitFor(struct Context* context, struct Queue* queue, enum Code next) { 5 __code meta_waitFor(struct Context* context, struct Queue* queue, enum Code next) {
6 context->data[Queue] = (union Data *)queue; 6 context->data[D_Queue] = (union Data *)queue;
7 goto (context->code[next])(context); 7 goto (context->code[next])(context);
8 } 8 }
9 9
10 __code waitFor1(struct Context* context, struct Task* master, struct Task* slave, struct Element* element) { 10 __code waitFor1(struct Context* context, struct Task* master, struct Task* slave, struct Element* element) {
11 element->data = (union Data *)slave; 11 element->data = (union Data *)slave;
27 //__code waitFor2_stub(struct Context* context) { 27 //__code waitFor2_stub(struct Context* context) {
28 // // next think 28 // // next think
29 //} 29 //}
30 30
31 __code meta_spawnTask(struct Context* context, struct Queue* queue, enum Code next) { 31 __code meta_spawnTask(struct Context* context, struct Queue* queue, enum Code next) {
32 context->data[Queue] = (union Data *)queue; 32 context->data[D_Queue] = (union Data *)queue;
33 goto (context->code[next])(context); 33 goto (context->code[next])(context);
34 } 34 }
35 35
36 __code spawnTask(struct Context* context, struct Task* task, struct Element* element, struct Queue* activeQueue, struct Queue* waitQueue) { 36 __code spawnTask(struct Context* context, struct Task* task, struct Element* element, struct Queue* activeQueue, struct Queue* waitQueue) {
37 //printf("spawn Task\n"); 37 //printf("spawn Task\n");
48 } 48 }
49 49
50 __code spawnTask_stub(struct Context* context) { 50 __code spawnTask_stub(struct Context* context) {
51 goto spawnTask(context, 51 goto spawnTask(context,
52 &context->data[context->dataNum-2]->task, 52 &context->data[context->dataNum-2]->task,
53 &context->data[Element]->element, 53 &context->data[D_Element]->element,
54 &context->data[ActiveQueue]->queue, 54 &context->data[D_ActiveQueue]->queue,
55 &context->data[WaitQueue]->queue); 55 &context->data[D_WaitQueue]->queue);
56 } 56 }
57 57
58 __code taskA(struct Context* context) { 58 __code taskA(struct Context* context) {
59 printf("TaskA\n"); 59 printf("TaskA\n");
60 goto meta(context, context->next); 60 goto meta(context, context->next);