From d5f5ca788c99698ca253d21fe88344b0bf026c42 Mon Sep 17 00:00:00 2001 From: alegrand Date: Thu, 12 Jun 2008 09:39:07 +0000 Subject: [PATCH] Bug fix 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 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/msg/msg_mailbox.c b/src/msg/msg_mailbox.c index 2dddabfedb..9cdb6d8f8f 100644 --- a/src/msg/msg_mailbox.c +++ b/src/msg/msg_mailbox.c @@ -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,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 */ -- 2.20.1