Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not give maestro a name, or it will change every output, invalidating any tests
[simgrid.git] / src / simix / smx_process.c
index fd4a7df..b7bb080 100644 (file)
@@ -27,6 +27,7 @@ void SIMIX_process_cleanup(void *arg)
 {
   xbt_swag_remove(arg, simix_global->process_to_run);
   xbt_swag_remove(arg, simix_global->process_list);
+  xbt_swag_remove(arg, ((smx_process_t)arg)->smx_host->process_list);
   xbt_swag_insert(arg, simix_global->process_to_destroy);
 }
 
@@ -42,22 +43,19 @@ void __SIMIX_create_maestro_process()
   process = xbt_new0(s_smx_process_t, 1);
 
   /* Process data */
-  process->name = (char *)"maestro";
+  process->name = (char *)"";
 
   /*Create the right context type (FIXME: check the return value for success)*/
   SIMIX_context_create_maestro(&process);
 
   /* Set it as the maestro process */
   simix_global->maestro_process = process;
-  
-  /* Now insert it in the global process list and in the process to run list */
-  /* FIXME should it be included in the process_list ??? */
-  xbt_swag_insert(process, simix_global->process_list);
+  simix_global->current_process = process;
 
   return;
 }
 
-/** 
+/**
  * \brief Creates and runs a new #smx_process_t.
  *
  * A constructor for #m_process_t taking four arguments and returning the corresponding object. The structure (and the corresponding thread) is created, and put in the list of ready process.
@@ -196,9 +194,6 @@ void SIMIX_process_kill(smx_process_t process)
   if (process->cond)
     xbt_swag_remove(process, process->cond->sleeping);
 
-  xbt_swag_remove(process, simix_global->process_to_run);
-  xbt_swag_remove(process, simix_global->process_list);
-
   DEBUG2("%p here! killing %p", simix_global->current_process, process);
   SIMIX_context_kill(process);
 
@@ -218,7 +213,6 @@ void SIMIX_process_kill(smx_process_t process)
 void *SIMIX_process_get_data(smx_process_t process)
 {
   xbt_assert0((process != NULL), "Invalid parameters");
-
   return (process->data);
 }
 
@@ -410,7 +404,7 @@ void SIMIX_process_change_host(smx_process_t process, char *source, char *dest)
  */
 int SIMIX_process_is_suspended(smx_process_t process)
 {
-  xbt_assert0(((process != NULL), "Invalid parameters");
+  xbt_assert0((process != NULL), "Invalid parameters");
 
   return (process->suspended);
 }