Mercurial > hg > Gears > GearsAgda
changeset 166:06cfc1289361
fix
author | mir3636 |
---|---|
date | Fri, 18 Nov 2016 19:34:44 +0900 |
parents | bf26f1105862 |
children | 34562e63981f |
files | src/parallel_execution/context.h src/parallel_execution/main.c src/parallel_execution/stack.cbc |
diffstat | 3 files changed, 23 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/context.h Thu Nov 17 18:34:39 2016 +0000 +++ b/src/parallel_execution/context.h Fri Nov 18 19:34:44 2016 +0900 @@ -151,6 +151,7 @@ } Time; struct LoopCounter { int i; + struct Tree* tree; } loopCounter; struct Worker { int num; @@ -171,14 +172,14 @@ struct Queue* waitMe; struct Queue* waitI; int idsCount; - } task; + } Task; struct Queue { struct Element* first; struct Element* last; int count; union Data* queue; enum Code next; - } queue; + } Queue; // Stack Interface struct Stack { union Data* stack; @@ -215,12 +216,13 @@ int* array; } array; struct Tree { - union Data* tree + union Data* tree; + struct Node* node; enum Code put; enum Code get; enum Code remove; enum Code next; - } tree; + } Tree; struct Traverse { struct Node* root; struct Node* current; // reading node of original tree
--- a/src/parallel_execution/main.c Thu Nov 17 18:34:39 2016 +0000 +++ b/src/parallel_execution/main.c Fri Nov 18 19:34:44 2016 +0900 @@ -146,7 +146,7 @@ waitMe, waitI, &context->data[D_Element]->element, - &context->data[D_ActiveQueue]->queue); + &context->data[D_ActiveQueue]->Queue); } @@ -220,7 +220,7 @@ goto putQueue2(context, &context->data[context->dataNum]->element, &context->data[D_Element]->element, - &context->data[D_Queue]->queue); + &context->data[D_Queue]->Queue); } __code putQueue3(struct Context* context, struct Queue* queue, struct Element* new_element) { @@ -237,7 +237,7 @@ } __code putQueue3_stub(struct Context* context) { - goto putQueue3(context, &context->data[D_Queue]->queue, &context->data[context->dataNum]->element); + goto putQueue3(context, &context->data[D_Queue]->Queue, &context->data[context->dataNum]->element); } __code putQueue4(struct Context* context, struct Queue* queue, struct Element* new_element) { @@ -252,7 +252,7 @@ } __code putQueue4_stub(struct Context* context) { - goto putQueue4(context, &context->data[D_Queue]->queue, &context->data[context->dataNum]->element); + goto putQueue4(context, &context->data[D_Queue]->Queue, &context->data[context->dataNum]->element); } __code createWorker(struct Context* context, struct LoopCounter* loopCounter, struct Worker* worker) {
--- a/src/parallel_execution/stack.cbc Thu Nov 17 18:34:39 2016 +0000 +++ b/src/parallel_execution/stack.cbc Fri Nov 18 19:34:44 2016 +0900 @@ -90,8 +90,19 @@ union Data* data, *data1; if (stack->top) { -zsh:1: command not found: nkf - + data = stack->top->data; + if (stack->top->next) { + data1 = stack->top->next->data; + } else { + data1 = NULL; + } + } else { + data = NULL; + data1 = NUll; + } + goto next(data, data1, ...); +} + __code isEmptySingleLinkedStack(struct SingleLinkedStack* stack, __code next(...), __code whenEmpty(...)) { if (stack->top) goto next(...);