Yes, the std::unique_lock
calls unlock on the mutex in its destructor.
The benefit of this is that in case some exception is thrown, you are sure that the mutex will unlock when leaving the scope where the std::unique_lock
is defined.
Yes, the std::unique_lock
calls unlock on the mutex in its destructor.
The benefit of this is that in case some exception is thrown, you are sure that the mutex will unlock when leaving the scope where the std::unique_lock
is defined.