Verify if the mutex unlock fails, abort if configured so.

git-svn-id: http://yate.null.ro/svn/yate/trunk@4958 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2012-03-07 17:03:22 +00:00
parent a3ef7e0139
commit cd895c0b08
1 changed files with 4 additions and 4 deletions

View File

@ -350,13 +350,13 @@ bool MutexPrivate::unlock()
Debug(DebugFail,"MutexPrivate::locks() is %d [%p]",locks,this);
}
}
if (!s_unsafe)
#ifdef _WINDOWS
::ReleaseMutex(m_mutex);
ok = s_unsafe || ::ReleaseMutex(m_mutex);
#else
::pthread_mutex_unlock(&m_mutex);
ok = s_unsafe || !::pthread_mutex_unlock(&m_mutex);
#endif
ok = true;
if (!ok)
Debug(DebugFail,"Failed to unlock mutex '%s' [%p]",m_name,this);
}
else
Debug(DebugFail,"MutexPrivate::unlock called on unlocked '%s' [%p]",m_name,this);