From: Gabriel Corona Date: Fri, 20 May 2016 08:00:19 +0000 (+0200) Subject: [simix] Remove SIMIX_process_create_from_wrapper() X-Git-Tag: v3_14~1189 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a9d46ef793944afed370e7612e5b38e43be9ecc5?hp=656d24a575ca26a64c94174ff3573272979e081d [simix] Remove SIMIX_process_create_from_wrapper() --- diff --git a/src/simix/smx_process.cpp b/src/simix/smx_process.cpp index f696d92b30..54d69329a9 100644 --- a/src/simix/smx_process.cpp +++ b/src/simix/smx_process.cpp @@ -201,29 +201,6 @@ void SIMIX_process_stop(smx_process_t arg) { arg->context->stop(); } -/** - * \brief Same as SIMIX_process_create() but with only one argument (used by timers). - * This function frees the argument. - * \return the process created - */ -smx_process_t SIMIX_process_create_from_wrapper(smx_process_arg_t args) { - - smx_process_t process = simix_global->create_process_function( - args->name, - args->code, - args->data, - args->hostname, - args->kill_time, - args->argc, - args->argv, - args->properties, - args->auto_restart, - NULL); - delete args; - return process; -} - - void* simcall_HANDLER_process_create(smx_simcall_t simcall, const char *name, xbt_main_func_t code, diff --git a/src/simix/smx_process_private.h b/src/simix/smx_process_private.h index 099821dcd4..fb96cb0d2d 100644 --- a/src/simix/smx_process_private.h +++ b/src/simix/smx_process_private.h @@ -91,7 +91,6 @@ XBT_PRIVATE smx_process_t SIMIX_process_create( XBT_PRIVATE void SIMIX_process_runall(void); XBT_PRIVATE void SIMIX_process_kill(smx_process_t process, smx_process_t issuer); XBT_PRIVATE void SIMIX_process_killall(smx_process_t issuer, int reset_pid); -XBT_PRIVATE smx_process_t SIMIX_process_create_from_wrapper(smx_process_arg_t args); XBT_PRIVATE void SIMIX_process_stop(smx_process_t arg); XBT_PRIVATE void SIMIX_process_cleanup(smx_process_t arg); XBT_PRIVATE void SIMIX_process_empty_trash(void); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index da1123517a..bd5166236b 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -604,8 +604,20 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process) arg->properties = current_property_set; XBT_DEBUG("Process %s(%s) will be started at time %f", arg->name, arg->hostname, start_time); - SIMIX_timer_set(start_time, [](void* arg) { - SIMIX_process_create_from_wrapper((smx_process_arg_t) arg); + SIMIX_timer_set(start_time, [](void* p) { + smx_process_arg_t arg = static_cast(p); + simix_global->create_process_function( + arg->name, + arg->code, + arg->data, + arg->hostname, + arg->kill_time, + arg->argc, + arg->argv, + arg->properties, + arg->auto_restart, + NULL); + delete arg; }, arg); } else { // start_time <= SIMIX_get_clock() XBT_DEBUG("Starting Process %s(%s) right now", arg->name, sg_host_get_name(host));