Skip to content
Snippets Groups Projects
Commit 68b6c046 authored by Eric Cano's avatar Eric Cano
Browse files

Added mutex destroy in a failure case.

parent a8d89c15
No related branches found
No related tags found
No related merge requests found
......@@ -40,8 +40,13 @@ castor::tape::threading::Mutex::Mutex() throw (castor::exception::Exception) {
"Error from pthread_mutexattr_settype in castor::tape::threading::Mutex::Mutex()");
throwOnReturnedErrno(pthread_mutex_init(&m_mutex, &attr),
"Error from pthread_mutex_init in castor::tape::threading::Mutex::Mutex()");
throwOnReturnedErrno(pthread_mutexattr_destroy(&attr),
"Error from pthread_mutexattr_destroy in castor::tape::threading::Mutex::Mutex()");
try {
throwOnReturnedErrno(pthread_mutexattr_destroy(&attr),
"Error from pthread_mutexattr_destroy in castor::tape::threading::Mutex::Mutex()");
} catch (...) {
pthread_mutex_destroy(&m_mutex);
throw;
}
}
castor::tape::threading::Mutex::~Mutex() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment