Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bug fix
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 12 Jun 2008 09:39:07 +0000 (09:39 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 12 Jun 2008 09:39:07 +0000 (09:39 +0000)
This check failed when selecting messages from a given host. It had to
be done even before entering this loop.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5611 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/msg/msg_mailbox.c

index 2dddabf..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);
 
 
   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)) {
   while (1) {
     /* if the mailbox is empty (has no task */
     if (!MSG_mailbox_is_empty(mailbox)) {
@@ -214,13 +221,6 @@ MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t * task,
       }
     }
 
       }
     }
 
-    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!");
-    }
-
     cond = SIMIX_cond_init();
 
     /* set the condition of the mailbox */
     cond = SIMIX_cond_init();
 
     /* set the condition of the mailbox */