diff options
Diffstat (limited to 'tools/ok.cpp')
-rw-r--r-- | tools/ok.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/ok.cpp b/tools/ok.cpp index b8c4f5b593..10f9afdbe0 100644 --- a/tools/ok.cpp +++ b/tools/ok.cpp @@ -119,6 +119,7 @@ struct SerialEngine : Engine { struct ThreadEngine : Engine { std::list<std::future<Status>> live; + const std::chrono::steady_clock::time_point the_past = std::chrono::steady_clock::now(); bool spawn(std::function<Status(void)> fn) override { live.push_back(std::async(std::launch::async, fn)); @@ -132,7 +133,7 @@ struct ThreadEngine : Engine { for (;;) { for (auto it = live.begin(); it != live.end(); it++) { - if (it->wait_for(std::chrono::seconds::zero()) == std::future_status::ready) { + if (it->wait_until(the_past) == std::future_status::ready) { Status s = it->get(); live.erase(it); return s; |