Title
Incorrect wording for condition_variable_any::wait_for
Status
c++11
Section
[thread.condition.condvarany]
Submitter
Anthony Williams

Created on 2009-11-17.00:00:00 last changed 161 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Remove [thread.condition.condvarany]p18 and [thread.condition.condvarany]p27.

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

18 Precondition: lock is locked by the calling thread, and either

  • no other thread is waiting on this condition_variable object or
  • lock.mutex() returns the same value for each of the lock arguments supplied by all concurrently waiting (via wait, wait_for, or wait_until) threads.

...

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

27 Precondition: lock is locked by the calling thread, and either

  • no other thread is waiting on this condition_variable object or
  • lock.mutex() returns the same value for each of the lock arguments supplied by all concurrently waiting (via wait, wait_for, or wait_until) threads.
Date: 2009-12-24.00:00:00

[ 2009-12-24 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]

Date: 2009-11-17.00:00:00

[thread.condition.condvarany]p18 and [thread.condition.condvarany]p27 specify incorrect preconditions for condition_variable_any::wait_for. The stated preconditions require that lock has a mutex() member function, and that this produces the same result for all concurrent calls to wait_for(). This is inconsistent with wait() and wait_until() which do not impose such a requirement.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg1372
2010-10-21 18:28:33adminsetmessages: + msg1371
2009-11-17 00:00:00admincreate