From 0b02f400ac3369708072d60d38c1b509d31a9957 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Fri, 25 Oct 2019 10:56:06 +0200 Subject: [PATCH 1/1] cosmetic (process->actor) --- src/s4u/s4u_Actor.cpp | 28 ++++++++++++++-------------- src/s4u/s4u_Host.cpp | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 51bfd453cd..5ec46126a8 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -45,7 +45,7 @@ Actor* Actor::self() } ActorPtr Actor::init(const std::string& name, s4u::Host* host) { - smx_actor_t self = SIMIX_process_self(); + kernel::actor::ActorImpl* self = SIMIX_process_self(); kernel::actor::ActorImpl* actor = kernel::actor::simcall([self, &name, host] { return self->init(name, host).get(); }); return actor->iface(); @@ -59,7 +59,7 @@ ActorPtr Actor::start(const std::function& code) ActorPtr Actor::create(const std::string& name, s4u::Host* host, const std::function& code) { - smx_actor_t self = SIMIX_process_self(); + kernel::actor::ActorImpl* self = SIMIX_process_self(); kernel::actor::ActorImpl* actor = kernel::actor::simcall([self, &name, host, &code] { return self->init(name, host)->start(code); }); @@ -95,8 +95,8 @@ void Actor::join() void Actor::join(double timeout) { - auto issuer = SIMIX_process_self(); - auto target = pimpl_; + kernel::actor::ActorImpl* issuer = SIMIX_process_self(); + kernel::actor::ActorImpl* target = pimpl_; kernel::actor::simcall_blocking([issuer, target, timeout] { if (target->finished_) { // The joined process is already finished, just wake up the issuer right away @@ -181,8 +181,8 @@ aid_t Actor::get_ppid() const void Actor::suspend() { - auto issuer = SIMIX_process_self(); - auto target = pimpl_; + kernel::actor::ActorImpl* issuer = SIMIX_process_self(); + kernel::actor::ActorImpl* target = pimpl_; s4u::Actor::on_suspend(*this); kernel::actor::simcall_blocking([issuer, target]() { target->suspend(); @@ -217,10 +217,10 @@ double Actor::get_kill_time() void Actor::kill() { - kernel::actor::ActorImpl* process = SIMIX_process_self(); - kernel::actor::simcall([this, process] { + kernel::actor::ActorImpl* self = SIMIX_process_self(); + kernel::actor::simcall([this, self] { xbt_assert(pimpl_ != simix_global->maestro_process, "Killing maestro is a rather bad idea"); - process->kill(pimpl_); + self->kill(pimpl_); }); } @@ -228,9 +228,9 @@ void Actor::kill() ActorPtr Actor::by_pid(aid_t pid) { - kernel::actor::ActorImpl* process = SIMIX_process_from_PID(pid); - if (process != nullptr) - return process->iface(); + kernel::actor::ActorImpl* actor = SIMIX_process_from_PID(pid); + if (actor != nullptr) + return actor->iface(); else return ActorPtr(); } @@ -277,8 +277,8 @@ namespace this_actor { */ bool is_maestro() { - kernel::actor::ActorImpl* process = SIMIX_process_self(); - return process == nullptr || process == simix_global->maestro_process; + kernel::actor::ActorImpl* self = SIMIX_process_self(); + return self == nullptr || self == simix_global->maestro_process; } void sleep_for(double duration) diff --git a/src/s4u/s4u_Host.cpp b/src/s4u/s4u_Host.cpp index 459c2900c1..2a78d57a29 100644 --- a/src/s4u/s4u_Host.cpp +++ b/src/s4u/s4u_Host.cpp @@ -654,8 +654,8 @@ void sg_host_get_actor_list(sg_host_t host, xbt_dynar_t whereto) sg_host_t sg_host_self() { - smx_actor_t process = SIMIX_process_self(); - return (process == nullptr) ? nullptr : process->get_host(); + simgrid::kernel::actor::ActorImpl* self = SIMIX_process_self(); + return (self == nullptr) ? nullptr : self->get_host(); } /* needs to be public and without simcall for exceptions and logging events */ -- 2.20.1