Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix some conflicts with modifications introduced in the svn branch
authorcristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 5 Oct 2009 15:41:53 +0000 (15:41 +0000)
committercristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 5 Oct 2009 15:41:53 +0000 (15:41 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6710 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/msg/m_process.c
src/msg/msg_mailbox.c
src/msg/private.h

index 739a784..48d8d41 100644 (file)
@@ -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;
   /* 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;
   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);
 
   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);
       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);
 
   xbt_fifo_remove(msg_global->process_list, process);
   SIMIX_process_kill(process->simdata->s_process);
 
index a0afff4..8c1cb6d 100644 (file)
@@ -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);
   }
 
   *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--;
   /* 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;
   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 */
   /* 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;
   }
 
   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--;
   /* If the receiver end didn't decremented the refcount so far then do it */
   if (t_simdata->refcount > 1)
     t_simdata->refcount--;
index b8f05b1..f7c617b 100644 (file)
@@ -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_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 */
        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 */