http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-10-25 
14:09:29 UTC ---
(In reply to comment #4)
> condition_variable_any is a bit more confusing. it says that it must be called
> in 30.5.2.10, but 30.5.2.9 say it is undefined, if lock is called or not

No no no, that's not what it says.

It says lock.lock() is called, that is a requirement. It must be called.

But calling lock.lock() could fail, so the note clarifies that it is
*unspecified* (not undefined!) whether the lock is *held*.

So lock.lock() will be called, but it might not succeed.

> ("Note: if any of the wait functions exits via an exception, it is unspecified
> whether the Lock is held. One can use a Lock type that allows to query that,
> such as the unique_lock wrapper.")... :/
> 
> i hope this is just a simple mistake in the spec (otherwise it would be a bit
> of a pain in the neck). do you have any more recent document to verify this?

It's not a mistake. http://lwg.github.com/issues/lwg-defects.html#1497

> perhaps this should be a separate bug report?

No, it's intimately related, I'll fix it all at once. But not until this
evening.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2406.html#gen_cond_var
covers all this, with a working implementation

Reply via email to