From 2c96bf50e2ab9d95ffa250c2cc2b19670a7a4414 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Fri, 10 Feb 2017 02:07:01 +0100 Subject: [PATCH] explicitly capture some other callback's scopes --- src/s4u/s4u_host.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/s4u/s4u_host.cpp b/src/s4u/s4u_host.cpp index 553f0bfb1e..2bf94917cd 100644 --- a/src/s4u/s4u_host.cpp +++ b/src/s4u/s4u_host.cpp @@ -102,7 +102,7 @@ Host *Host::current(){ void Host::turnOn() { if (isOff()) { - simgrid::simix::kernelImmediate([&]{ + simgrid::simix::kernelImmediate([this] { this->extension()->turnOn(); this->pimpl_cpu->turnOn(); onStateChange(*this); @@ -113,7 +113,7 @@ void Host::turnOn() { void Host::turnOff() { if (isOn()) { smx_actor_t self = SIMIX_process_self(); - simgrid::simix::kernelImmediate([&] { + simgrid::simix::kernelImmediate([this, self] { SIMIX_host_off(this, self); onStateChange(*this); }); @@ -197,7 +197,7 @@ void Host::setProperty(const char*key, const char *value){ /** Get the processes attached to the host */ xbt_swag_t Host::processes() { - return simgrid::simix::kernelImmediate([this]() { + return simgrid::simix::kernelImmediate([this] { return this->extension()->process_list; }); } @@ -230,7 +230,7 @@ int Host::coreCount() { /** @brief Set the pstate at which the host should run */ void Host::setPstate(int pstate_index) { - simgrid::simix::kernelImmediate([this, pstate_index](){ + simgrid::simix::kernelImmediate([this, pstate_index] { this->pimpl_cpu->setPState(pstate_index); }); } -- 2.20.1