X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fc9db1be8c886672e63a1589a5a2b8e9a9561818..cdcc1673b336818fcd4c37f93e8c7cb184015fd1:/src/msg/msg_legacy.cpp?ds=sidebyside diff --git a/src/msg/msg_legacy.cpp b/src/msg/msg_legacy.cpp index 26693aa738..aa909f4db7 100644 --- a/src/msg/msg_legacy.cpp +++ b/src/msg/msg_legacy.cpp @@ -55,7 +55,9 @@ int MSG_task_listen(const char* alias) /* ************************** Actors *************************** */ void MSG_process_on_exit(int_f_int_pvoid_t fun, void* data) { - sg_actor_on_exit(fun, data); + /* We can't use the sg_actor_on_exit, as the return type of the callback changed: the int in MSG is ignored and was + * removed in sg */ + simgrid::s4u::this_actor::on_exit([fun, data](bool failed) { fun(failed ? 1 /*FAILURE*/ : 0 /*SUCCESS*/, data); }); } int MSG_process_get_PID(const_sg_actor_t actor) @@ -94,7 +96,7 @@ void MSG_process_resume(sg_actor_t actor) { sg_actor_resume(actor); } -int MSG_process_is_suspended(sg_actor_t actor) +int MSG_process_is_suspended(const_sg_actor_t actor) { return sg_actor_is_suspended(actor); } @@ -155,7 +157,7 @@ void* MSG_process_get_data(const_sg_actor_t process) xbt_assert(process != nullptr, "Invalid parameter: first parameter must not be nullptr!"); /* get from SIMIX the MSG process data, and then the user data */ - return sg_actor_data(process); + return sg_actor_get_data(process); } /** @brief Sets the user data of a process. @@ -165,7 +167,7 @@ void* MSG_process_get_data(const_sg_actor_t process) msg_error_t MSG_process_set_data(msg_process_t process, void* data) { xbt_assert(process != nullptr, "Invalid parameter: first parameter must not be nullptr!"); - sg_actor_data_set(process, data); + sg_actor_set_data(process, data); return MSG_OK; } @@ -218,9 +220,9 @@ void MSG_process_unref(const_sg_actor_t process) sg_actor_unref(process); } /** @brief Return the current number MSG processes. */ -int MSG_process_get_number() +int MSG_process_get_number() // XBT_ATTRIB_DEPRECATED_v330 { - return simgrid_get_actor_count(); + return sg_actor_count(); } /* ************************** NetZones *************************** */ sg_netzone_t MSG_zone_get_root() @@ -329,11 +331,11 @@ const char* MSG_host_get_name(const_sg_host_t host) } void* MSG_host_get_data(const_sg_host_t host) { - return sg_host_data(host); + return sg_host_get_data(host); } void MSG_host_set_data(sg_host_t host, void* data) { - return sg_host_data_set(host, data); + return sg_host_set_data(host, data); } xbt_dict_t MSG_host_get_mounted_storage_list(sg_host_t host) // XBT_ATTRIB_DEPRECATED_v330 {