Commit df0be021 authored by Fred Suter's avatar Fred Suter

depreacate SIMIX_process_on_exit

parent 7b0e03ac
......@@ -90,7 +90,8 @@ XBT_ATTRIB_DEPRECATED_v329("This function will be removed in 3.29") XBT_PUBLIC v
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 *********************************/
......
......@@ -389,7 +389,7 @@ void ActorImpl::resume()
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);
});
......@@ -579,7 +579,8 @@ smx_actor_t SIMIX_process_from_PID(aid_t PID)
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);
......
......@@ -123,7 +123,7 @@ void Actor::set_auto_restart(bool autorestart)
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment