| 199 | |
| 200 | template<typename T> |
| 201 | T waitForFuture(std::future<T>& future) { |
| 202 | auto status = future.wait_for(std::chrono::seconds(1)); |
| 203 | if (status != std::future_status::ready) { |
| 204 | throw Valdi::Exception("Timed out while waiting for future to become ready"); |
| 205 | } |
| 206 | return future.get(); |
| 207 | } |
| 208 | |
| 209 | void runParallel(size_t threadsCount, int64_t durationSeconds, Valdi::DispatchFunction run); |
| 210 |