X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/96cedde3cdbc0b8ffc3f096a1b65d021b0226f99..debe4e5871c0c3d1c714bbb1bd28ba7147454aa5:/src/msg/msg_legacy.cpp diff --git a/src/msg/msg_legacy.cpp b/src/msg/msg_legacy.cpp index 431070eed8..fd4562c206 100644 --- a/src/msg/msg_legacy.cpp +++ b/src/msg/msg_legacy.cpp @@ -3,6 +3,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include "simgrid/Exception.hpp" #include "src/msg/msg_private.hpp" #define MSG_CALL(type, oldname, args) @@ -124,6 +125,26 @@ void MSG_process_yield() sg_actor_yield(); } +msg_error_t MSG_process_sleep(double duration) +{ + try { + sg_actor_sleep_for(duration); + return MSG_OK; + } catch (simgrid::HostFailureException& e) { + return MSG_HOST_FAILURE; + } +} + +msg_process_t MSG_process_attach(const char* name, void* data, msg_host_t host, xbt_dict_t properties) +{ + return sg_actor_attach(name, data, host, properties); +} + +void MSG_process_detach() +{ + sg_actor_detach(); +} + /* ************************** NetZones *************************** */ sg_netzone_t MSG_zone_get_root() { @@ -273,9 +294,9 @@ int MSG_host_is_on(sg_host_t h) { return sg_host_is_on(h); } -int MSG_host_is_off(sg_host_t h) +int MSG_host_is_off(sg_host_t h) // deprecated { - return sg_host_is_off(h); + return not sg_host_is_on(h); } xbt_dict_t MSG_host_get_properties(sg_host_t host) {