X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dccf1b41e9c7b5a696f01abceaa2779fe65f154f..77bbf3027c4240a2e833209a3a3f186589da8577:/include/simgrid/simix/blocking_simcall.hpp diff --git a/include/simgrid/simix/blocking_simcall.hpp b/include/simgrid/simix/blocking_simcall.hpp index 3a41904109..682b2eeb73 100644 --- a/include/simgrid/simix/blocking_simcall.hpp +++ b/include/simgrid/simix/blocking_simcall.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2016. The SimGrid Team. +/* Copyright (c) 2016-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -81,20 +81,20 @@ auto kernelSync(F code) -> decltype(code().get()) template class Future { public: - Future() {} + Future() { /* Nothing to do*/} Future(simgrid::kernel::Future future) : future_(std::move(future)) {} bool valid() const { return future_.valid(); } T get() { - if (!valid()) + if (not valid()) throw std::future_error(std::future_errc::no_state); smx_actor_t self = SIMIX_process_self(); simgrid::xbt::Result result; simcall_run_blocking([this, &result, self]{ try { // When the kernel future is ready... - this->future_.then_([this, &result, self](simgrid::kernel::Future value) { + this->future_.then_([&result, self](simgrid::kernel::Future value) { // ... wake up the process with the result of the kernel future. simgrid::xbt::setPromise(result, value); simgrid::simix::unblock(self); @@ -109,7 +109,7 @@ public: } bool is_ready() const { - if (!valid()) + if (not valid()) throw std::future_error(std::future_errc::no_state); return future_.is_ready(); }