Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove sg_platf_*_add_cb, use the signal<T> directly
[simgrid.git] / src / msg / msg_mailbox.h
index ded6199..7ac2c96 100644 (file)
@@ -1,15 +1,16 @@
-/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2008-2015. 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. */
+ * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #ifndef MSG_MAILBOX_H
 #define MSG_MAILBOX_H
 
+#include <xbt/base.h>
 #include "xbt/fifo.h"
 #include "simgrid/simix.h"
-#include "msg/datatypes.h"
+#include "simgrid/msg.h"
 
 
 SG_BEGIN_DECL()
@@ -27,7 +28,7 @@ SG_BEGIN_DECL()
 XBT_PUBLIC(msg_mailbox_t)
     MSG_mailbox_new(const char *alias);
 
-void MSG_mailbox_free(void *mailbox);
+XBT_PRIVATE void MSG_mailbox_free(void *mailbox);
 
 /* \brief MSG_mailbox_free - release a mailbox from the memory.
  *
@@ -38,7 +39,7 @@ void MSG_mailbox_free(void *mailbox);
  *
  * \see      MSG_mailbox_destroy.
  */
-void MSG_mailbox_free(void *mailbox);
+XBT_PRIVATE void MSG_mailbox_free(void *mailbox);
 
 /* \brief MSG_mailbox_get_by_alias - get a mailbox from its alias.
  *
@@ -66,6 +67,19 @@ XBT_PUBLIC(msg_mailbox_t)
  */
 XBT_PUBLIC(int) MSG_mailbox_is_empty(msg_mailbox_t mailbox);
 
+/* \brief MSG_mailbox_set_async - set a mailbox as eager
+ *
+ * The function MSG_mailbox_set_async sets the mailbox to a permanent receiver mode
+ * Messages sent to this mailbox will then be sent just after the send is issued,
+ * without waiting for the corresponding receive.
+ *
+ * This call should be done before issuing any receive, and on the receiver's side only
+ *
+ * \param alias    The alias of the mailbox to modify.
+ *
+ */
+XBT_PUBLIC(void) MSG_mailbox_set_async(const char *alias);
+
 /*! \brief MSG_mailbox_get_head - get the task at the head of a mailbox.
  *
  * The MSG_mailbox_get_head returns the task at the head of the mailbox.