From 36b3b8b80bee4178c77b22f6130b44b542660eea Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 1 Jun 2018 14:42:56 +0200 Subject: [PATCH 1/1] Use new style SIMIX_process_on_exit(). --- src/simix/ActorImpl.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index caabcb26ca..b83645a3d7 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -141,7 +141,7 @@ ActorImpl::~ActorImpl() delete this->context; } -static int dying_daemon(void* exit_status, void* data) +static void dying_daemon(int /*exit_status*/, void* data) { std::vector* vect = &simix_global->daemons; @@ -151,9 +151,8 @@ static int dying_daemon(void* exit_status, void* data) /* Don't move the whole content since we don't really care about the order */ std::swap(*it, vect->back()); vect->pop_back(); - - return 0; } + /** This process will be terminated automatically when the last non-daemon process finishes */ void ActorImpl::daemonize() { @@ -652,12 +651,11 @@ smx_activity_t SIMIX_process_join(smx_actor_t issuer, smx_actor_t process, doubl smx_activity_t res = issuer->sleep(timeout); intrusive_ptr_add_ref(res.get()); SIMIX_process_on_exit(process, - [](void*, void* arg) { + [](int, void* arg) { auto sleep = static_cast(arg); if (sleep->surf_sleep) sleep->surf_sleep->finish(simgrid::kernel::resource::Action::State::FINISHED); intrusive_ptr_release(sleep); - return 0; }, res.get()); return res; -- 2.20.1