X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/90d012e147a92dd7c78f0d0e8d1614b6559eb450..93298f333e0a978ac17aee86fa69b64e14668f94:/src/simix/ActorImpl.cpp diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index be85cd753c..e51e517c89 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -204,29 +204,6 @@ void SIMIX_maestro_create(void (*code)(void*), void* data) simgrid::simix::create_maestro(std::bind(code, data)); } -/** - * \brief Stops a process. - * - * Stops the process, execute all the registered on_exit functions, - * register it to the list of the process to restart if needed - * and stops its context. - */ -void SIMIX_process_stop(smx_actor_t arg) { - arg->finished = true; - /* execute the on_exit functions */ - SIMIX_process_on_exit_runall(arg); - /* Add the process to the list of process to restart, only if the host is down */ - if (arg->auto_restart && arg->host->isOff()) { - SIMIX_host_add_auto_restart_process(arg->host, arg->name.c_str(), - arg->code, arg->data, - SIMIX_timer_get_date(arg->kill_timer), - arg->properties, - arg->auto_restart); - } - XBT_DEBUG("Process %s@%s is dead", arg->cname(), arg->host->cname()); - arg->context->stop(); -} - /** * \brief Internal function to create a process. * @@ -834,7 +811,19 @@ void SIMIX_process_yield(smx_actor_t self) if (self->context->iwannadie){ XBT_DEBUG("I wanna die!"); - SIMIX_process_stop(self); + self->finished = true; + /* execute the on_exit functions */ + SIMIX_process_on_exit_runall(self); + /* Add the process to the list of process to restart, only if the host is down */ + if (self->auto_restart && self->host->isOff()) { + SIMIX_host_add_auto_restart_process(self->host, self->cname(), + self->code, self->data, + SIMIX_timer_get_date(self->kill_timer), + self->properties, + self->auto_restart); + } + XBT_DEBUG("Process %s@%s is dead", self->cname(), self->host->cname()); + self->context->stop(); } if (self->suspended) {