From: Martin Quinson Date: Thu, 19 Jan 2017 15:06:51 +0000 (+0100) Subject: make sure that the HostStateChange event is fired when needed X-Git-Tag: v3_15~535 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/203ec9f9985a3e1f4f4672a6349200acfa853194 make sure that the HostStateChange event is fired when needed --- diff --git a/src/s4u/s4u_host.cpp b/src/s4u/s4u_host.cpp index 28ad5980d6..d918006bcb 100644 --- a/src/s4u/s4u_host.cpp +++ b/src/s4u/s4u_host.cpp @@ -105,13 +105,18 @@ void Host::turnOn() { simgrid::simix::kernelImmediate([&]{ this->extension()->turnOn(); this->pimpl_cpu->turnOn(); + onStateChange(*this); }); } } void Host::turnOff() { if (isOn()) { - simgrid::simix::kernelImmediate(std::bind(SIMIX_host_off, this, SIMIX_process_self())); + smx_actor_t self = SIMIX_process_self(); + simgrid::simix::kernelImmediate([&] { + SIMIX_host_off(this, self); + onStateChange(*this); + }); } }