Added more warnings for abnormal conditions.

git-svn-id: http://voip.null.ro/svn/yate@1831 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2008-03-21 15:25:10 +00:00
parent 8db40267eb
commit f72e85d7a1
1 changed files with 8 additions and 0 deletions

View File

@ -164,8 +164,10 @@ MutexPrivate::MutexPrivate(bool recursive)
MutexPrivate::~MutexPrivate()
{
bool warn = false;
GlobalMutex::lock();
if (m_locked) {
warn = true;
m_locked--;
s_locks--;
#ifdef _WINDOWS
@ -182,6 +184,12 @@ MutexPrivate::~MutexPrivate()
::pthread_mutex_destroy(&m_mutex);
#endif
GlobalMutex::unlock();
if (m_locked)
Debug(DebugFail,"MutexPrivate owned by '%s' destroyed with %u locks [%p]",
m_owner,m_locked,this);
else if (warn)
Debug(DebugGoOn,"MutexPrivate owned by '%s' unlocked in destructor [%p]",
m_owner,this);
}
bool MutexPrivate::lock(long maxwait)