-/**
- * \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,
- sg_host_get_name(arg->host),
- SIMIX_timer_get_date(arg->kill_timer),
- arg->properties,
- arg->auto_restart);
- }
- XBT_DEBUG("Process %s (%s) is dead",
- arg->name.c_str(), sg_host_get_name(arg->host));
- arg->context->stop();
-}
-