X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d17f206ea75d3cccc5f1b83b67f58d4fe87781d1..d1f1e22acb2e2342b535c3847e804b4a5fee3167:/src/surf/sg_platf.cpp diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 5f7f50d686..43f06efb85 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -9,6 +9,7 @@ #include "xbt/str.h" #include "xbt/dict.h" #include "xbt/RngStream.h" +#include #include #include "src/surf/HostImpl.hpp" #include "surf/surf.h" @@ -572,7 +573,7 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process) double kill_time = process->kill_time; int auto_restart = process->on_failure == SURF_PROCESS_ON_FAILURE_DIE ? 0 : 1; - std::function code = simgrid::simix::wrap_main(parse_code, process->argc, process->argv); + std::function code = simgrid::xbt::wrapMain(parse_code, process->argc, process->argv); smx_process_arg_t arg = NULL; smx_process_t process_created = NULL; @@ -601,8 +602,7 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process) XBT_DEBUG("Process %s(%s) will be started at time %f", arg->name.c_str(), arg->hostname, start_time); - SIMIX_timer_set(start_time, [](void* p) { - smx_process_arg_t arg = static_cast(p); + SIMIX_timer_set(start_time, [=]() { simix_global->create_process_function( arg->name.c_str(), std::move(arg->code), @@ -613,7 +613,7 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process) arg->auto_restart, NULL); delete arg; - }, arg); + }); } else { // start_time <= SIMIX_get_clock() XBT_DEBUG("Starting Process %s(%s) right now", arg->name.c_str(), sg_host_get_name(host));