git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5413
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
/* ****************************** Process *********************************** */
typedef struct simdata_process *simdata_process_t;
/** @brief Process datatype
/* ****************************** Process *********************************** */
typedef struct simdata_process *simdata_process_t;
/** @brief Process datatype
typedef int m_channel_t;
/** @} */
typedef int m_channel_t;
/** @} */
+/* ******************************** Mailbox ************************************ */
+
+typedef struct s_msg_mailbox* msg_mailbox_t;
+/** @brief Mailbox datatype
+ @ingroup m_datatypes_management_details @{ */
+
+msg_mailbox_t MSG_mailbox_create(const char *alias);
+void MSG_mailbox_free(void* mailbox);
+
+
+/** @} */
+
+
/* ***************************** Error handling ***************************** */
/** @brief Error handling
@ingroup m_datatypes_management
/* ***************************** Error handling ***************************** */
/** @brief Error handling
@ingroup m_datatypes_management
XBT_PUBLIC(int)
MSG_task_listen_from(const char* alias);
XBT_PUBLIC(int)
MSG_task_listen_from(const char* alias);
+/************************** Task handling ************************************/
+XBT_PUBLIC(MSG_error_t)
+MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t* task, m_host_t host, double timeout);
+
+XBT_PUBLIC(MSG_error_t)
+MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task, double timeout);
+
\r
#define MAX_ALIAS_NAME ((size_t)260)\r
\r
\r
#define MAX_ALIAS_NAME ((size_t)260)\r
\r
-/* forward declaration */\r
-typedef struct s_msg_mailbox* msg_mailbox_t;\r
-\r
/*\r
* Initialization of the mailbox module.\r
*/\r
/*\r
* Initialization of the mailbox module.\r
*/\r
-MSG_mailbox_new(const char *alias)\r
+MSG_mailbox_create(const char *alias)\r
{\r
msg_mailbox_t mailbox = xbt_new0(s_msg_mailbox_t,1);\r
\r
mailbox->tasks = xbt_fifo_new();\r
mailbox->cond = NULL;\r
{\r
msg_mailbox_t mailbox = xbt_new0(s_msg_mailbox_t,1);\r
\r
mailbox->tasks = xbt_fifo_new();\r
mailbox->cond = NULL;\r
- mailbox->alias = xbt_strdup(alias);\r
+ mailbox->alias = alias ? xbt_strdup(alias) : NULL;\r
mailbox->hostname = NULL;\r
\r
mailbox->hostname = NULL;\r
\r
- /* add the mbox in the dictionary */\r
- xbt_dict_set(msg_mailboxes, alias, mailbox, MSG_mailbox_free);\r
- \r
return mailbox;\r
}\r
\r
msg_mailbox_t\r
return mailbox;\r
}\r
\r
msg_mailbox_t\r
-MSG_mailbox_create(const char *alias)\r
+MSG_mailbox_new(const char *alias)\r
- msg_mailbox_t mailbox = xbt_new0(s_msg_mailbox_t,1);\r
+ msg_mailbox_t mailbox = MSG_mailbox_create(alias);\r
- mailbox->tasks = xbt_fifo_new();\r
- mailbox->cond = NULL;\r
- mailbox->alias = xbt_strdup(alias);\r
- mailbox->hostname = NULL;\r
+ /* add the mbox in the dictionary */\r
+ xbt_dict_set(msg_mailboxes, alias, mailbox, MSG_mailbox_free);\r