diff src/parallel_execution/generate_context.pl @ 284:e6bc0a4c2c36

generate C_start_code and C_exit_code
author mir3636
date Sun, 05 Feb 2017 19:08:22 +0900
parents 2c2e4e597eb0
children bc17237bc8cf
line wrap: on
line diff
--- a/src/parallel_execution/generate_context.pl	Sun Feb 05 18:30:30 2017 +0900
+++ b/src/parallel_execution/generate_context.pl	Sun Feb 05 19:08:22 2017 +0900
@@ -46,7 +46,7 @@
 our($opt_o,$opt_d,$opt_h);
 getopts('o:d:h');
 
-my $name = $opt_o;
+my $name = $opt_o?$opt_o:"gears";
 
 if ($opt_d) {
     $ddir = $opt_d;
@@ -112,6 +112,8 @@
 }
 
 sub generateContext {
+    $codeGear{"start_code"} = "$ddir/$name-context.c";
+    $codeGear{"exit_code"} = "$ddir/$name-context.c";
     open my $fd,">","$ddir/extern.h" or die("can't open $ddir/extern.h $!");
     for my $code ( sort keys %codeGear ) {
         print $fd "extern __code ${code}_stub(struct Context*);\n";
@@ -150,9 +152,6 @@
 
 $code_init
 
-    context->code[C_start_code]    = start_code_stub;
-    context->code[C_exit_code]    = exit_code_stub;
-
 #include "dataGearInit.c"
 
     // context->data[D_ActiveQueue] = createSynchronizedQueue(context);