diff src/parallel_execution/generate_context.pl @ 397:c43ec0e3fa84

Add par_meta
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Thu, 24 Aug 2017 17:23:41 +0900
parents 45afe5d70956
children fc4fcd441700
line wrap: on
line diff
--- a/src/parallel_execution/generate_context.pl	Thu Aug 24 15:32:38 2017 +0900
+++ b/src/parallel_execution/generate_context.pl	Thu Aug 24 17:23:41 2017 +0900
@@ -168,6 +168,13 @@
     print $fd $context_c;
 
 my $meta_call = <<"EOFEOF";
+__code par_meta(struct Context* context, enum Code spawns, enum Code next) {
+    if (context->contexts != NULL) {
+        context->contexts = NULL;
+        goto (context->code[spawns])(context);
+    }
+    goto (context->code[next])(context);
+}
 
 __code meta(struct Context* context, enum Code next) {
     // printf("meta %d\\n",next);