Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reverting Mt's modifications. There is a problem in MSG_process_kill. I need to ensur...
[simgrid.git] / src / msg / m_process.c
index 21f8d36..813bef2 100644 (file)
@@ -34,7 +34,7 @@ m_process_t MSG_process_create(const char *name,
                               m_process_code_t code, void *data,
                               m_host_t host)
 {
-  return MSG_process_create_with_arguments(name, code, data, host, -1, NULL, 0.0, -1.0);
+  return MSG_process_create_with_arguments(name, code, data, host, -1, NULL);
 }
 
 static void MSG_process_cleanup(void *arg)
@@ -80,8 +80,7 @@ static void MSG_process_cleanup(void *arg)
  */
 m_process_t MSG_process_create_with_arguments(const char *name,
                                              m_process_code_t code, void *data,
-                                             m_host_t host, int argc, char **argv,
-                                             double start_time, double kill_time)
+                                             m_host_t host, int argc, char **argv)
 {
   simdata_process_t simdata = xbt_new0(s_simdata_process_t,1);
   m_process_t process = xbt_new0(s_m_process_t,1);
@@ -95,7 +94,6 @@ m_process_t MSG_process_create_with_arguments(const char *name,
   simdata->waiting_task = NULL;
   simdata->argc = argc;
   simdata->argv = argv;
-  simdata->kill_time = kill_time;
   simdata->context = xbt_context_new(code, NULL, NULL, 
                                     MSG_process_cleanup, process, 
                                     simdata->argc, simdata->argv);
@@ -121,12 +119,7 @@ m_process_t MSG_process_create_with_arguments(const char *name,
   msg_global->current_process = self;
 
   xbt_fifo_push(msg_global->process_list, process);
-  if (start_time == 0.0) {     
-     xbt_fifo_push(msg_global->process_to_run, process);
-  } else {
-     /* FIXME: let the process sleep for the specified amount of time */
-     xbt_fifo_push(msg_global->process_to_run, process);
-  }
+  xbt_fifo_push(msg_global->process_to_run, process);
 
   PAJE_PROCESS_NEW(process);
 
@@ -172,6 +165,7 @@ void MSG_process_kill(m_process_t process)
     }
   }
 
+  xbt_fifo_remove(msg_global->process_to_run,process);
   xbt_fifo_remove(msg_global->process_list,process);
   xbt_context_free(process->simdata->context);
 }