The C ++ 11 standard defines unique_lock::unlockhow (ยง 30.4.2.2.2, p. 1159)
void unlock();
Effects: pm->unlock()
Postcondition: owns == false
Throws: system_error when an exception is required (30.2.2).
Error conditions:
โ operation_not_permitted โ if on entry owns is false.
All other blocking operations indicate that an exception is raised in at least two cases:
- Mutex is NULL (throws
system_errorwith errc::operation_not_permitted) - Mutex is already locked (throws
system_errorusing errc::operation_not_permitted)
The problem with an invalid mutez is obviously possible for unlock, however, the standard indicates the behavior of the program only for problems with blocking. Is this a real mistake in the standard or am I missing something?
user283145
source
share