From: cristianrosa Date: Mon, 5 Oct 2009 15:41:53 +0000 (+0000) Subject: Fix some conflicts with modifications introduced in the svn branch X-Git-Tag: SVN~1003 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d1476ed63c5c33d5a1395b70ac17374e07f7b80d?hp=43307e6167f4be7aa7016e16df4e55f6f1973188 Fix some conflicts with modifications introduced in the svn branch git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6710 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/msg/m_process.c b/src/msg/m_process.c index 739a784448..48d8d413bc 100644 --- a/src/msg/m_process.c +++ b/src/msg/m_process.c @@ -154,6 +154,7 @@ m_process_t MSG_process_create_with_environment(const char *name, /* Simulator Data */ simdata->PID = msg_global->PID++; simdata->waiting_action = NULL; + simdata->waiting_task = NULL; simdata->m_host = host; simdata->argc = argc; simdata->argv = argv; @@ -195,15 +196,16 @@ void MSG_process_kill(m_process_t process) DEBUG3("Killing %s(%d) on %s", process->name, p_simdata->PID, p_simdata->m_host->name); - if (p_simdata->waiting_task) { - DEBUG1("Canceling waiting task %s", p_simdata->waiting_task->name); - if (p_simdata->waiting_task->simdata->compute) { - SIMIX_action_cancel(p_simdata->waiting_task->simdata->compute); - } else if (p_simdata->waiting_task->simdata->comm) { + if (p_simdata->waiting_task && p_simdata->waiting_task->simdata->comm) { SIMIX_communication_cancel(p_simdata->waiting_task->simdata->comm); - } } - + + if (p_simdata->waiting_action) { + DEBUG1("Canceling waiting task %s", + SIMIX_action_get_name(p_simdata->waiting_action)); + SIMIX_action_cancel(p_simdata->waiting_action); + } + xbt_fifo_remove(msg_global->process_list, process); SIMIX_process_kill(process->simdata->s_process); diff --git a/src/msg/msg_mailbox.c b/src/msg/msg_mailbox.c index a0afff4def..8c1cb6da5e 100644 --- a/src/msg/msg_mailbox.c +++ b/src/msg/msg_mailbox.c @@ -151,7 +151,7 @@ MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t *task, m_host_t host, } *task = SIMIX_communication_get_data(comm); - + /* If the sender didn't decremented the refcount so far then do it */ if (*task && (*task)->simdata->refcount > 1) (*task)->simdata->refcount--; @@ -182,7 +182,7 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task, msg_global->sent_msg++; process->simdata->waiting_task = task; - + /* Try to send it by calling SIMIX network layer */ TRY{ /* Kept for semantical compatibility with older implementation */ @@ -211,7 +211,7 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task, } process->simdata->waiting_task = NULL; - + /* If the receiver end didn't decremented the refcount so far then do it */ if (t_simdata->refcount > 1) t_simdata->refcount--; diff --git a/src/msg/private.h b/src/msg/private.h index b8f05b1b62..f7c617b212 100644 --- a/src/msg/private.h +++ b/src/msg/private.h @@ -68,6 +68,7 @@ SG_BEGIN_DECL() m_host_t put_host; /* used for debugging purposes */ m_channel_t put_channel; /* used for debugging purposes */ smx_action_t waiting_action; + m_task_t waiting_task; int argc; /* arguments number if any */ char **argv; /* arguments table if any */ MSG_error_t last_errno; /* the last value returned by a MSG_function */