Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move one method from ModelChecker to Exploration
[simgrid.git] / src / mc / ModelChecker.cpp
index 8804000..5aa7399 100644 (file)
@@ -220,7 +220,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
                get_exploration()->get_record_trace().to_string().c_str());
       exploration_->log_state();
 
-      this->exit(SIMGRID_MC_EXIT_SAFETY);
+      exploration_->system_exit(SIMGRID_MC_EXIT_SAFETY);
 
     default:
       xbt_die("Unexpected message from model-checked application");
@@ -228,13 +228,6 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
   return true;
 }
 
-/** Terminate the model-checker application */
-void ModelChecker::exit(int status)
-{
-  get_exploration()->get_remote_app().shutdown();
-  ::exit(status);
-}
-
 void ModelChecker::handle_waitpid()
 {
   XBT_DEBUG("Check for wait event");
@@ -263,7 +256,7 @@ void ModelChecker::handle_waitpid()
         if (WIFSIGNALED(status)) {
           MC_report_crash(exploration_, status);
           this->get_remote_process_memory().terminate();
-          this->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
+          exploration_->system_exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
         }
       }
 #endif
@@ -283,7 +276,7 @@ void ModelChecker::handle_waitpid()
       else if (WIFSIGNALED(status)) {
         MC_report_crash(exploration_, status);
         this->get_remote_process_memory().terminate();
-        this->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
+        exploration_->system_exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
       } else if (WIFEXITED(status)) {
         XBT_DEBUG("Child process is over");
         this->get_remote_process_memory().terminate();