mutex.lock();
try
{
foo(); // can throw exception
}
catch (...)
{
mutex.unlock();
throw;
}
mutex.unlock();
To guaranty the unlock i must call mutex.unlock()
in catch block and in normal case. Is there any option to avoid duplication?
Thank You