2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-01 08:32:08 +00:00

Reconcile condition_variable::wait_for(pred) with wait_until(pred).

This commit is contained in:
Nat Goodspeed
2015-09-03 07:13:01 -04:00
parent b465af2c39
commit bd2eb2fe72

View File

@@ -160,12 +160,9 @@ public:
template< typename LockType, typename Rep, typename Period, typename Pred >
bool wait_for( LockType & lt, std::chrono::duration< Rep, Period > const& timeout_duration, Pred pred) {
while ( ! pred() ) {
if ( cv_status::timeout == wait_for( lt, timeout_duration) ) {
return pred();
}
}
return true;
return wait_until( lt,
std::chrono::high_resolution_clock::now() + timeout_duration,
pred);
}
};