A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue3504 below:

Issue 3504: condition_variable::wait_for is overspecified


template<class Rep, class Period>
  cv_status wait_for(unique_lock<mutex>& lock,
                     const chrono::duration<Rep, Period>& rel_time);

-23- Preconditions: lock.owns_lock() is true and lock.mutex() is locked by the calling thread, and either [...]

-24- Effects: Equivalent to:

return wait_until(lock, chrono::steady_clock::now() + rel_time rel-to-abs(rel_time));

[...]


template<class Rep, class Period, class Predicate>
  cv_status wait_for(unique_lock<mutex>& lock,
                     const chrono::duration<Rep, Period>& rel_time,
                     Predicate pred);

-35- Preconditions: lock.owns_lock() is true and lock.mutex() is locked by the calling thread, and either [...]

-36- Effects: Equivalent to:

return wait_until(lock, chrono::steady_clock::now() + rel_time rel-to-abs(rel_time), std::move(pred));

[Note 8: There is no blocking if pred() is initially true, even if the timeout has already expired. — end note]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4