+
+ // Retrieving the self() context
+ /** @brief Retrives the current context of this thread */
+ static Context* self();
+ /** @brief Sets the current context of this thread */
+ static void set_current(Context* self);
+
+ class StopRequest {
+ /** @brief Exception launched to kill a process, in order to properly unwind its stack and release RAII stuff
+ *
+ * Nope, Sonar, this should not inherit of std::exception nor of simgrid::Exception.
+ * Otherwise, users may accidentally catch it with a try {} catch (std::exception)
+ */
+ public:
+ StopRequest() = default;
+ explicit StopRequest(std::string msg) : msg_(std::string("Actor killed (") + msg + std::string(").")) {}
+ virtual const char* what() const noexcept { return msg_.c_str(); }
+
+ private:
+ std::string msg_ = std::string("Actor killed.");
+ };