- simcall_run_blocking([this, &result, self]{
- try {
- // When the kernel future is ready...
- this->future_.then_([&result, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
- // ... wake up the process with the result of the kernel future.
- simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(value));
- simgrid::simix::unblock(self);
- });
- }
- catch (...) {
- result.set_exception(std::current_exception());
- simgrid::simix::unblock(self);
- }
- });
+ simcall_run_blocking(
+ [this, &result, self] {
+ try {
+ // When the kernel future is ready...
+ this->future_.then_([&result, self](std::shared_ptr<simgrid::kernel::FutureState<T>> value) {
+ // ... wake up the process with the result of the kernel future.
+ simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(std::move(value)));
+ simgrid::simix::unblock(self);
+ });
+ } catch (...) {
+ result.set_exception(std::current_exception());
+ simgrid::simix::unblock(self);
+ }
+ },
+ nullptr);