
25 Aug
2007
25 Aug
'07
8:06 p.m.
Yuval Ronen:
Peter Dimov wrote:
Yuval Ronen:
Checking in runtime is enough, IMO.
How do you suggest this runtime checking be implemented?
assert(m_mutex.locked());
Well... this implies that a condition is always associated with a mutex and that the Mutex concept provides a locked() query, which it currently does not. In principle one may check for a try_lock failure, although this doesn't tell us which thread has locked the mutex. Given that you already have a lock variable at the point you are calling wait, what's wrong with just passing it?