If create a unique_lock as below, can I unlock it without destroying or getting out of scope? In other words is this safe/acceptable?
std::mutex queueMutex;
// My understanding is that this locks the mutex
std::unique_lock<std::mutex> lk(queueMutex);
{
// My critical section
}
// Is it unlocking it properly, or do I have to pop it from the stack?
lk.unlock();
thx!