Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / src / kernel / context / Context.cpp
index 1a51d04..dedbf2c 100644 (file)
@@ -93,8 +93,7 @@ void Context::stop()
   XBT_DEBUG("%s@%s(%ld) should not run anymore", actor_->get_cname(), actor_->iface()->get_host()->get_cname(),
             actor_->get_pid());
 
-  if (this->actor_ == simix_global->maestro_process) /* Do not cleanup maestro */
-    this->actor_->cleanup();
+  this->actor_->cleanup();
 
   this->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), because that's me
   simgrid::simix::simcall([this] {
@@ -102,7 +101,7 @@ void Context::stop()
 
     /* Unregister from the kill timer if any */
     if (actor_->kill_timer != nullptr) {
-      SIMIX_timer_remove(actor_->kill_timer);
+      actor_->kill_timer->remove();
       actor_->kill_timer = nullptr;
     }
 
@@ -113,25 +112,6 @@ void Context::stop()
 
 AttachContext::~AttachContext() = default;
 
-StopRequest::~StopRequest() = default;
-
-void StopRequest::do_throw()
-{
-  throw StopRequest();
-}
-
-bool StopRequest::try_n_catch(std::function<void(void)> try_block)
-{
-  bool res;
-  try {
-    try_block();
-    res = true;
-  } catch (StopRequest const&) {
-    XBT_DEBUG("Caught a StopRequest");
-    res = false;
-  }
-  return res;
-}
 }}}
 
 /** @brief Executes all the processes to run (in parallel if possible). */