-/* Copyright (c) 2016-2021. The SimGrid Team.
+/* Copyright (c) 2016-2022. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include <xbt/base.h>
#include <xbt/functional.hpp>
-#include <xbt/future.hpp>
+#include <xbt/promise.hpp>
namespace simgrid {
namespace kernel {
**/
void resolve()
{
- if (status_ != FutureStatus::ready)
- xbt_die("Deadlock: this future is not ready");
+ xbt_assert(status_ == FutureStatus::ready, "Deadlock: this future is not ready");
status_ = FutureStatus::done;
if (exception_) {
std::exception_ptr exception = std::move(exception_);
public:
Future() = default;
explicit Future(std::shared_ptr<FutureState<T>> state) : state_(std::move(state)) {}
- ~Future() = default;
// Move type:
Future(Future&) = delete;
* auto promise = std::make_shared<simgrid::kernel::Promise<T>>();
* auto future = promise->get_future();
*
- * simgrid::simix::Timer::set(date, [promise] {
+ * simgrid::kernel::timer::Timer::set(date, [promise] {
* try {
* int value = compute_the_value();
* if (value < 0)