- smx_ctx_lua_t context = xbt_new0(s_smx_ctx_lua_t, 1);
-
- /* 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;
- INFO1("Created context for function %s",argv[0]);
-
- /* start the coroutine in charge of running that code */
- context->state = lua_newthread(lua_state);
- context->ref = luaL_ref(lua_state, LUA_REGISTRYINDEX); // protect the thread from being garbage collected
- /* the actual co-routine starting is done in smx_ctx_lua_start */
- context->nargs = argc-1;
- } else {
- INFO0("Created context for maestro");
- }
-
- return (smx_context_t)context;
+ return smx_ctx_sysv_create_context_sized(sizeof(s_smx_ctx_sysv_t),
+ code,argc,argv,cleanup_func,cleanup_arg);