Why is std::mutex::unlock()
not noexept
? For some reason the standard leaves the behavior undefined when a thread that does not own the mutex calls unlock()
on it. What is the justification for doing so? Doesn't this cause std::unique_lock
or std::lock_guard
destructors implementations from accidentally leaking exceptions in their destructors if the function throws?
Note Destructors that throw - https://akrzemi1.wordpress.com/2011/09/21/destructors-that-throw/