Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move the actor lifecycle markers from Context to ActorImpl
[simgrid.git] / src / kernel / context / Context.cpp
index b20d7869fe42cf8739b9b6adec6587ed440056eb..c6728df38eb579e48146bb81470428646392aac9 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "mc/mc.h"
 
+#include "simgrid/Exception.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/kernel/context/Context.hpp"
@@ -138,13 +139,8 @@ Context::~Context()
 
 void Context::stop()
 {
-  this->actor_->cleanup();
-}
-
-void Context::set_wannadie(bool value)
-{
-  XBT_DEBUG("Actor %s gonna die.", actor_->get_cname());
-  iwannadie_ = value;
+  this->actor_->cleanup_from_self();
+  throw ForcefulKillException(); // clean RAII variables with the dedicated exception
 }
 AttachContext::~AttachContext() = default;