+ /* If the user provided a function for the process then use it
+ otherwise is the context for maestro */
+ if(code){
+ context->code = code;
+ context->argc = argc;
+ context->argv = argv;
+ context->cleanup_func = cleanup_func;
+ context->cleanup_arg = cleanup_arg;
+ context->begin = xbt_os_sem_init(0);
+ context->end = xbt_os_sem_init(0);
+
+
+ /* create and start the process */
+ /* NOTE: The first argument to xbt_os_thread_create used to be the process *
+ * name, but now the name is stored at SIMIX level, so we pass a null */
+ context->thread =
+ xbt_os_thread_create(NULL, smx_ctx_thread_wrapper, ctx_thread);
+
+ /* wait the starting of the newly created process */
+ xbt_os_sem_acquire(context->end);
+ }
+