Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Let the state in a coherent state after MSG_clean()
[simgrid.git] / src / msg / global.c
index 6118573..c8ae395 100644 (file)
@@ -46,7 +46,6 @@ void MSG_global_init(int *argc, char **argv)
      
     msg_global = xbt_new0(s_MSG_Global_t,1);
 
-    xbt_context_init();
     msg_global->host = xbt_fifo_new();
     msg_global->process_to_run = xbt_fifo_new();
     msg_global->process_list = xbt_fifo_new();
@@ -291,7 +290,7 @@ void __MSG_display_process_status(void)
 /* FIXME: Yeah, I'll do it in a portable maner one day [Mt] */
 #include <signal.h>
 
-static void inthandler(int ignored)
+static void _XBT_CALL inthandler(int ignored)
 {
    INFO0("CTRL-C pressed. Displaying status and bailing out");
    __MSG_display_process_status();
@@ -423,7 +422,7 @@ MSG_error_t MSG_main(void)
   }
 
   if (xbt_fifo_size(msg_global->process_list) == 0) {
-    INFO0("Congratulations ! Simulation terminated : all processes are over");
+/*     INFO0("Congratulations ! Simulation terminated : all processes are over"); */
     return MSG_OK;
   } else {
     INFO0("Oops ! Deadlock or code not perfectly clean.");
@@ -482,7 +481,6 @@ MSG_error_t MSG_clean(void)
   while((p=xbt_fifo_pop(msg_global->process_list))) {
     MSG_process_kill(p);
   }
-  xbt_context_exit();
 
   xbt_fifo_foreach(msg_global->host,i,h,m_host_t) {
     __MSG_host_destroy(h);
@@ -499,6 +497,7 @@ MSG_error_t MSG_clean(void)
   }
   msg_config_finalize();
   free(msg_global);
+  msg_global = NULL;
   surf_exit();
 
   return MSG_OK;