Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Declare this_actor::exit() [[noreturn]].
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 27 Sep 2021 12:13:01 +0000 (14:13 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 27 Sep 2021 19:14:29 +0000 (21:14 +0200)
include/simgrid/actor.h
include/simgrid/s4u/Actor.hpp
src/s4u/s4u_Actor.cpp

index d43239b..1e72cb8 100644 (file)
@@ -41,7 +41,7 @@ static inline void sg_actor_start(sg_actor_t actor, xbt_main_func_t code, int ar
 }
 XBT_PUBLIC void sg_actor_set_stacksize(sg_actor_t actor, unsigned size);
 
-XBT_PUBLIC void sg_actor_exit();
+XBT_ATTRIB_NORETURN XBT_PUBLIC void sg_actor_exit();
 XBT_PUBLIC void sg_actor_on_exit(void_f_int_pvoid_t fun, void* data);
 
 XBT_PUBLIC aid_t sg_actor_get_pid(const_sg_actor_t actor);
index 067fdd7..76ba654 100644 (file)
@@ -366,7 +366,7 @@ XBT_PUBLIC void suspend();
 XBT_PUBLIC void yield();
 
 /** @brief kill the current actor. */
-XBT_PUBLIC void exit();
+XBT_ATTRIB_NORETURN XBT_PUBLIC void exit();
 
 /** @brief Add a function to the list of "on_exit" functions of the current actor.
  *
index 3635696..182c08d 100644 (file)
@@ -423,6 +423,7 @@ void exit()
 {
   kernel::actor::ActorImpl* self = simgrid::kernel::actor::ActorImpl::self();
   simgrid::kernel::actor::simcall([self] { self->exit(); });
+  THROW_IMPOSSIBLE;
 }
 
 void on_exit(const std::function<void(bool)>& fun)