- context->cleanup_func = cleanup_func;
- context->cleanup_arg = cleanup_arg;
- context->exception = xbt_new(ex_ctx_t, 1);
- XBT_CTX_INITIALIZE(context->exception);
- context->jprocess = (jobject) code;
- context->jenv = get_current_thread_env();
-
+ /* If the user provided a function for the process then use it
+ otherwise is the context for maestro */
+ if(code){
+ context->cleanup_func = cleanup_func;
+ context->cleanup_arg = cleanup_arg;
+ context->jprocess = (jobject) code;
+ context->jenv = get_current_thread_env();
+ jprocess_start(((smx_ctx_java_t) context)->jprocess,
+ get_current_thread_env());
+ }
+