Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bug fix
[simgrid.git] / src / msg / msg_mailbox.c
index 22c8fb4..9cdb6d8 100644 (file)
@@ -190,6 +190,13 @@ MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t * task,
 
   SIMIX_mutex_lock(h->simdata->mutex);
 
+  if (MSG_mailbox_get_cond(mailbox)) {
+    CRITICAL1("A process is already blocked on the channel %s",
+             MSG_mailbox_get_alias(mailbox));
+    SIMIX_cond_display_info(MSG_mailbox_get_cond(mailbox));
+    xbt_die("Go fix your code!");
+  }
+
   while (1) {
     /* if the mailbox is empty (has no task */
     if (!MSG_mailbox_is_empty(mailbox)) {
@@ -214,10 +221,6 @@ MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t * task,
       }
     }
 
-    xbt_assert1(!MSG_mailbox_get_cond(mailbox),
-               "A process is already blocked on the channel %s",
-               MSG_mailbox_get_alias(mailbox));
-
     cond = SIMIX_cond_init();
 
     /* set the condition of the mailbox */