]> AND Public Git Repository - simgrid.git/blobdiff - acmacro/context.m4
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use local variable in each user code so that they don't get intermixed with each...
[simgrid.git] / acmacro / context.m4
index f90eaf530f62bb8ed26fc4c444b7b98bbb7dc2de..f4faefc71828ff7a95f7c28a811d0f590893f3f7 100644 (file)
@@ -134,10 +134,8 @@ AC_TRY_RUN([
 ucontext_t uc_child;
 ucontext_t uc_main;
 
-void child(void *arg)
+void child(void)
 {
-    if (arg != (void *)12345)
-        exit(1);
     if (swapcontext(&uc_child, &uc_main) != 0)
         exit(2);
 }
@@ -162,7 +160,7 @@ int main(int argc, char *argv[])
     uc_child.uc_stack.ss_sp = (char *)stack+(32*1024);
     uc_child.uc_stack.ss_size = 32*1024;
     uc_child.uc_stack.ss_flags = 0;
-    makecontext(&uc_child, child, 2, (void *)12345);
+    makecontext(&uc_child, child, 0);
 
     /* switch into the user context */
     if (swapcontext(&uc_main, &uc_child) != 0)
@@ -343,7 +341,7 @@ int main(int argc, char *argv[])
         uc_handler.uc_stack.ss_sp    = (void *)(skaddr + sksize);
         uc_handler.uc_stack.ss_size  = sksize;
         uc_handler.uc_stack.ss_flags = 0;
-        makecontext(&uc_handler, handler, 1);
+        makecontext(&uc_handler, handler, 0);
         swapcontext(&uc_main, &uc_handler);
     }
 #endif