3 /* Copyright (c) 2008-2015. The SimGrid Team.
4 * All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
11 #include "simgrid/msg.h"
12 #include "msg_private.h"
13 #include "simgrid/s4u/Actor.hpp"
14 #include "simgrid/s4u/Mailbox.hpp"
16 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_mailbox, msg, "Logging specific to MSG (mailbox)");
18 /** \ingroup msg_mailbox_management
19 * \brief Set the mailbox to receive in asynchronous mode
21 * All messages sent to this mailbox will be transferred to the receiver without waiting for the receive call.
22 * The receive call will still be necessary to use the received data.
23 * If there is a need to receive some messages asynchronously, and some not, two different mailboxes should be used.
25 * \param alias The name of the mailbox
27 void MSG_mailbox_set_async(const char *alias){
28 simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(alias);
29 mailbox->setReceiver(simgrid::s4u::Actor::self());
30 XBT_VERB("%s mailbox set to receive eagerly for myself\n",alias);