# HG changeset patch # User matac42 # Date 1641656198 -32400 # Node ID 7adec76a1adfae7d6c5962d83f40ee65f7a2216b # Parent 088e533b5393ec994edf885a9028d8f41d394b2a fix ls diff -r 088e533b5393 -r 7adec76a1adf src/parallel_execution/examples/gearsDirectory/GearsDirectoryImpl.cbc --- a/src/parallel_execution/examples/gearsDirectory/GearsDirectoryImpl.cbc Thu Jan 06 21:33:58 2022 +0900 +++ b/src/parallel_execution/examples/gearsDirectory/GearsDirectoryImpl.cbc Sun Jan 09 00:36:38 2022 +0900 @@ -59,11 +59,18 @@ goto cDirectory->get(dir, ls2); } -__code ls2(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) { - printf("%d\n", gearsDirectory->currentDirectory->fTree->Node.value->Node.key); +__code ls2(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) { + printf("%d\n", node->key); goto next(...); } +__code ls2_stub(struct Context* context) { + GearsDirectoryImpl* gearsDirectory = (GearsDirectoryImpl*)GearImpl(context, GearsDirectory, gearsDirectory); + Integer* name = Gearef(context, FTree)->node; + enum Code next = Gearef(context, GearsDirectory)->next; + goto ls2(context, gearsDirectory, name, next); +} + __code cd2Child(struct GearsDirectoryImpl* gearsDirectory, struct Integer* name, __code next(...)) { // 現在のtreeからnode->keyがnameと一致するものをsearch struct FTree* cDirectory = new FTree(); diff -r 088e533b5393 -r 7adec76a1adf src/parallel_execution/examples/gearsDirectory/GearsDirectory_test.cbc --- a/src/parallel_execution/examples/gearsDirectory/GearsDirectory_test.cbc Thu Jan 06 21:33:58 2022 +0900 +++ b/src/parallel_execution/examples/gearsDirectory/GearsDirectory_test.cbc Sun Jan 09 00:36:38 2022 +0900 @@ -6,7 +6,7 @@ __code task1(GearsDirectory* gearsDirectory){ Integer* name = new Integer(); name->value = 1; - goto gearsDirectory->mkdir(name, task5); + goto gearsDirectory->mkdir(name, task4); } __code task1_stub(struct Context* context){ @@ -34,9 +34,20 @@ goto task3(context, gearsDirectory); } +__code task4(GearsDirectory* gearsDirectory){ + Integer* name = new Integer(); + name->value = 2; + goto gearsDirectory->mkdir(name, task5); +} + +__code task4_stub(struct Context* context){ + GearsDirectory* gearsDirectory = createGearsDirectoryImpl(context); + goto task4(context, gearsDirectory); +} + __code task5(GearsDirectory* gearsDirectory){ Integer* name = new Integer(); - name->value = 1; + name->value = 2; goto gearsDirectory->ls(name, exit_code); }