From: Frederic Suter Date: Tue, 22 May 2018 00:46:23 +0000 (+0200) Subject: one more legacy MSG function X-Git-Tag: v3.20~202 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7dfcd2aaf386196ce3022317d5402a7016279d43 one more legacy MSG function --- diff --git a/include/simgrid/actor.h b/include/simgrid/actor.h index 0e72156dd0..e44db8c0aa 100644 --- a/include/simgrid/actor.h +++ b/include/simgrid/actor.h @@ -31,6 +31,7 @@ XBT_PUBLIC void sg_actor_suspend(sg_actor_t actor); XBT_PUBLIC void sg_actor_resume(sg_actor_t actor); XBT_PUBLIC int sg_actor_is_suspended(sg_actor_t actor); XBT_PUBLIC sg_actor_t sg_actor_restart(sg_actor_t actor); +void sg_actor_set_auto_restart(sg_actor_t actor, int auto_restart); XBT_PUBLIC void sg_actor_daemonize(sg_actor_t actor); XBT_PUBLIC void sg_actor_migrate(sg_actor_t process, sg_host_t host); XBT_PUBLIC void sg_actor_join(sg_actor_t actor, double timeout); diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index 93a9c97141..3ff8e91d3f 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -140,6 +140,7 @@ XBT_PUBLIC void MSG_process_suspend(msg_process_t process); XBT_PUBLIC void MSG_process_resume(msg_process_t process); XBT_PUBLIC int MSG_process_is_suspended(msg_process_t process); XBT_PUBLIC void MSG_process_restart(msg_process_t process); +XBT_PUBLIC void MSG_process_auto_restart_set(msg_process_t process, int auto_restart); XBT_PUBLIC void MSG_process_daemonize(msg_process_t process); XBT_PUBLIC void MSG_process_migrate(msg_process_t process, msg_host_t host); XBT_PUBLIC void MSG_process_join(msg_process_t process, double timeout); @@ -253,7 +254,6 @@ XBT_PUBLIC void* MSG_process_get_data(msg_process_t process); XBT_PUBLIC msg_error_t MSG_process_set_data(msg_process_t process, void* data); XBT_PUBLIC void MSG_process_on_exit(int_f_pvoid_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_ref(msg_process_t process); XBT_PUBLIC void MSG_process_unref(msg_process_t process); diff --git a/src/msg/msg_legacy.cpp b/src/msg/msg_legacy.cpp index eb797db6e4..43ac1771be 100644 --- a/src/msg/msg_legacy.cpp +++ b/src/msg/msg_legacy.cpp @@ -74,6 +74,11 @@ void MSG_process_restart(sg_actor_t actor) { sg_actor_restart(actor); } +void MSG_process_auto_restart_set(sg_actor_t actor, int auto_restart) +{ + sg_actor_set_auto_restart(actor, auto_restart); +} + void MSG_process_daemonize(sg_actor_t actor) { sg_actor_daemonize(actor); diff --git a/src/msg/msg_process.cpp b/src/msg/msg_process.cpp index 3d637e466c..1932fc55f2 100644 --- a/src/msg/msg_process.cpp +++ b/src/msg/msg_process.cpp @@ -307,15 +307,6 @@ smx_context_t MSG_process_get_smx_ctx(msg_process_t process) { // deprecated -- void MSG_process_on_exit(int_f_pvoid_pvoid_t fun, void *data) { simgrid::s4u::this_actor::on_exit(fun, data); } -/** - * \ingroup m_process_management - * \brief Sets the "auto-restart" flag of the process. - * If the flag is set to 1, the process will be automatically restarted when its host comes back up. - */ -XBT_PUBLIC void MSG_process_auto_restart_set(msg_process_t process, int auto_restart) -{ - process->set_auto_restart(auto_restart); -} /** @ingroup m_process_management * @brief Take an extra reference on that process to prevent it to be garbage-collected diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 1aac413272..18339edffd 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -541,6 +541,16 @@ sg_actor_t sg_actor_restart(sg_actor_t actor) return actor->restart(); } +/** + * \ingroup m_actor_management + * \brief Sets the "auto-restart" flag of the actor. + * If the flag is set to 1, the actor will be automatically restarted when its host comes back up. + */ +void sg_actor_set_auto_restart(sg_actor_t actor, int auto_restart) +{ + actor->set_auto_restart(auto_restart); +} + /** @ingroup m_actor_management * @brief This actor will be terminated automatically when the last non-daemon actor finishes */