XBT_PUBLIC(void) MSG_process_on_exit(int_f_pvoid_t fun, void *data);
XBT_PUBLIC(void) MSG_process_auto_restart_set(msg_process_t process, int auto_restart);
-XBT_PUBLIC(void) MSG_process_restart(msg_process_t process);
+XBT_PUBLIC(msg_process_t) MSG_process_restart(msg_process_t process);
/************************** Task handling ************************************/
XBT_PUBLIC(msg_task_t) MSG_task_create(const char *name,
XBT_PUBLIC(void) simcall_process_set_kill_time(smx_process_t process, double kill_time);
XBT_PUBLIC(void) simcall_process_on_exit(smx_process_t process, int_f_pvoid_t fun, void *data);
XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_process_t process, int auto_restart);
-XBT_PUBLIC(void) simcall_process_restart(smx_process_t process);
+XBT_PUBLIC(smx_process_t) simcall_process_restart(smx_process_t process);
/* Sleep control */
XBT_PUBLIC(e_smx_state_t) simcall_process_sleep(double duration);
* \ingroup m_process_management
* \brief Restarts a process from the beginning.
*/
-XBT_PUBLIC(void) MSG_process_restart(msg_process_t process) {
- simcall_process_restart(process);
+XBT_PUBLIC(msg_process_t) MSG_process_restart(msg_process_t process) {
+ return simcall_process_restart(process);
}
* \brief Restart a process.
* Restart a process, starting it again from the beginning.
*/
-void SIMIX_process_restart(smx_process_t process, smx_process_t issuer) {
+smx_process_t SIMIX_process_restart(smx_process_t process, smx_process_t issuer) {
XBT_DEBUG("Restarting process %s on %s", process->name, process->smx_host->name);
//retrieve the arguments of the old process
//FIXME: Factorise this with SIMIX_host_add_auto_restart_process ?
arg.auto_restart);
}
-
+ return new_process;
}
void SIMIX_process_sleep_resume(smx_action_t action);
void SIMIX_process_sleep_destroy(smx_action_t action);
void SIMIX_process_auto_restart_set(smx_process_t process, int auto_restart);
-void SIMIX_process_restart(smx_process_t process, smx_process_t issuer);
+smx_process_t SIMIX_process_restart(smx_process_t process, smx_process_t issuer);
#endif
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_PROCESS_RESTART:
- SIMIX_process_restart(simcall->process_restart.process, simcall->issuer);
+ simcall->process_restart.result = SIMIX_process_restart(simcall->process_restart.process, simcall->issuer);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_PROCESS_AUTO_RESTART_SET:
struct {
smx_process_t process;
+ smx_process_t result;
} process_restart;
struct {
* \ingroup simix_process_management
* \brief Restarts the process, killing it and starting it again from scratch.
*/
-XBT_PUBLIC(void) simcall_process_restart(smx_process_t process)
+XBT_PUBLIC(smx_process_t) simcall_process_restart(smx_process_t process)
{
smx_simcall_t simcall = SIMIX_simcall_mine();
simcall->process_restart.process = process;
SIMIX_simcall_push(simcall->issuer);
+
+ return simcall->process_restart.result;
}
/**
* \ingroup simix_process_management