Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
218671054d02f0e5f2c2328e0a3f44d05ae6518a
[simgrid.git] / src / msg / msg_mailbox.cpp
1 /* Mailboxes in MSG */
2
3 /* Copyright (c) 2008-2015. The SimGrid Team.
4  * All rights reserved.                                                     */
5
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. */
8
9 #include <xbt/ex.hpp>
10
11 #include "simgrid/msg.h"
12 #include "msg_private.h"
13 #include "simgrid/s4u/Actor.hpp"
14 #include "simgrid/s4u/Mailbox.hpp"
15
16 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_mailbox, msg, "Logging specific to MSG (mailbox)");
17
18 /** \ingroup msg_mailbox_management
19  * \brief Set the mailbox to receive in asynchronous mode
20  *
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.
24  *
25  * \param alias The name of the mailbox
26  */
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);
31 }
32