From: Jonathan Rouzaud-Cornabas Date: Tue, 12 Feb 2013 13:39:29 +0000 (+0100) Subject: Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid X-Git-Tag: v3_9_90~494^2~18 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2e9105988280d1e88b5b496d6e2eed4c8d541883 Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid --- 2e9105988280d1e88b5b496d6e2eed4c8d541883 diff --cc src/msg/msg_gos.c index 7eb2d791e2,e37e0d7002..aeb6ad343b --- a/src/msg/msg_gos.c +++ b/src/msg/msg_gos.c @@@ -307,35 -267,23 +322,48 @@@ MSG_task_receive_ext(msg_task_t * task XBT_DEBUG ("MSG_task_receive_ext: Trying to receive a message on mailbox '%s'", alias); - return MSG_mailbox_get_task_ext(MSG_mailbox_get_by_alias(alias), task, - host, timeout); + TRY { + ret = MSG_mailbox_get_task_ext(MSG_mailbox_get_by_alias(alias), task, + host, timeout); + } + CATCH(e) { + switch (e.category) { + case cancel_error: /* may be thrown by MSG_mailbox_get_by_alias */ + ret = MSG_HOST_FAILURE; + break; + default: + RETHROW; + } + xbt_ex_free(e); + } + return ret; } +/** \ingroup msg_task_usage + * \brief Receives a task from a mailbox from a specific host with a given timeout + * and at a given rate. + * + * \param task a memory location for storing a #msg_task_t. + * \param alias name of the mailbox to receive the task from + * \param timeout is the maximum wait time for completion (provide -1 for no timeout) + * \param host a #msg_host_t host from where the task was sent + * \param rate limit the reception to rate bandwidth + * + * \return Returns + * #MSG_OK if the task was successfully received, +* #MSG_HOST_FAILURE, or #MSG_TRANSFER_FAILURE, or #MSG_TIMEOUT otherwise. + */ +msg_error_t +MSG_task_receive_ext_bounded(msg_task_t * task, const char *alias, double timeout, + msg_host_t host, double rate) +{ + XBT_DEBUG + ("MSG_task_receive_ext: Trying to receive a message on mailbox '%s'", + alias); + return MSG_mailbox_get_task_ext_bounded(MSG_mailbox_get_by_alias(alias), task, + host, timeout, rate); +} + /** \ingroup msg_task_usage * \brief Sends a task on a mailbox. *