| 250 | } |
| 251 | |
| 252 | void waited(const Future<T>& future) |
| 253 | { |
| 254 | CHECK(!future.isPending()); |
| 255 | |
| 256 | ready += 1; |
| 257 | if (ready == futures.size()) { |
| 258 | // It is safe to move futures at this point. |
| 259 | promise->set(std::move(futures)); |
| 260 | terminate(this); |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | std::vector<Future<T>> futures; |
| 265 | Promise<std::vector<Future<T>>>* promise; |