X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cbd8dae6d524fc62b0fb5fcf7b2604e98f953615..4485d715fa3a090c1dd38def83ab8239feebecb3:/src/msg/msg_legacy.cpp diff --git a/src/msg/msg_legacy.cpp b/src/msg/msg_legacy.cpp index 53f3cb3e91..578f862cf2 100644 --- a/src/msg/msg_legacy.cpp +++ b/src/msg/msg_legacy.cpp @@ -1,8 +1,9 @@ -/* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved. */ /* 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,15 @@ 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; + } +} /* ************************** NetZones *************************** */ sg_netzone_t MSG_zone_get_root() { @@ -273,9 +283,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) {