| 2483 | } |
| 2484 | |
| 2485 | ContinueFuture Task::taskCompletionFuture() { |
| 2486 | std::lock_guard<std::timed_mutex> l(mutex_); |
| 2487 | // If 'this' is running, the future is realized on timeout or when |
| 2488 | // this no longer is running. |
| 2489 | if (not isRunningLocked()) { |
| 2490 | return makeFinishFutureLocked( |
| 2491 | fmt::format("Task::taskCompletionFuture {}", taskId_).data()); |
| 2492 | } |
| 2493 | auto [promise, future] = makeBoltContinuePromiseContract( |
| 2494 | fmt::format("Task::taskCompletionFuture {}", taskId_)); |
| 2495 | taskCompletionPromises_.emplace_back(std::move(promise)); |
| 2496 | return std::move(future); |
| 2497 | } |
| 2498 | |
| 2499 | std::string Task::toString() const { |
| 2500 | std::lock_guard<std::timed_mutex> l(mutex_); |