SG_END_DECL
#ifdef __cplusplus
-XBT_PUBLIC void SIMIX_process_on_exit(smx_actor_t process, const std::function<void(bool /*failed*/)>& fun);
+XBT_ATTRIB_DEPRECATED_v329("This function will be removed in 3.29") XBT_PUBLIC
+ void SIMIX_process_on_exit(smx_actor_t process, const std::function<void(bool /*failed*/)>& fun);
#endif
/****************************** Communication *********************************/
activity::ActivityImplPtr ActorImpl::join(ActorImpl* actor, double timeout)
{
activity::ActivityImplPtr sleep = this->sleep(timeout);
- SIMIX_process_on_exit(actor, [sleep](bool) {
+ actor->on_exit->emplace_back([sleep](bool) {
if (sleep->surf_action_)
sleep->surf_action_->finish(resource::Action::State::FINISHED);
});
return item->second;
}
-void SIMIX_process_on_exit(smx_actor_t actor, const std::function<void(bool /*failed*/)>& fun)
+void SIMIX_process_on_exit(smx_actor_t actor,
+ const std::function<void(bool /*failed*/)>& fun) // XBT_ATTRIB_DEPRECATED_v329
{
xbt_assert(actor, "current process not found: are you in maestro context ?");
actor->on_exit->emplace_back(fun);
void Actor::on_exit(const std::function<void(bool /*failed*/)>& fun) const
{
- kernel::actor::simcall([this, &fun] { SIMIX_process_on_exit(pimpl_, fun); });
+ kernel::actor::simcall([this, &fun] { pimpl_->on_exit->emplace_back(fun); });
}
void Actor::set_host(Host* new_host)