On sábado, 12 de agosto de 2017 11:41:38 PDT Paul "TBBle" Hampson wrote:
> Perhaps this is okay, in that looking slightly wider,
> std::unique_lock::unlock's only listed error condition is "if on entry owns
> is false", while BasicLockable's unlock() member function "*Requires:* The
> current execution agent shall hold a lock on m.".
>
> If we can equate std::unique_lock::owns with "the current execution agent
> holds a lock on the std::unique_lock instance" then the standard is fine:
> So as long as you meet the BasicLockable *Requires* clause to call unlock(),
> then unique_lock::unlock won't violate the BasicLockable *Throws* clause.
>
> Is this latter approach the right way to read that?
I would read it like that. If you use the API correctly, it won't throw.
--
Thiago Macieira - thiago (AT)
macieira.info - thiago (AT)
kde.org
Software Architect - Intel Open Source Technology Center