Abort immediately on highly critical errors even if not requested from command line.

git-svn-id: http://yate.null.ro/svn/yate/trunk@2043 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2008-07-01 14:57:43 +00:00
parent 5cf769272c
commit d1b55ca3e7
2 changed files with 7 additions and 2 deletions

View File

@ -271,8 +271,11 @@ void MutexPrivate::unlock()
tname,m_owner,this);
m_owner = 0;
}
if (--s_locks < 0)
if (--s_locks < 0) {
// this is very very bad - abort right now
abortOnBug(true);
Debug(DebugFail,"MutexPrivate::locks() is %d [%p]",s_locks,this);
}
#ifdef _WINDOWS
::ReleaseMutex(m_mutex);
#else

View File

@ -97,8 +97,10 @@ class ThreadPrivateKeyAlloc
public:
ThreadPrivateKeyAlloc()
{
if (::pthread_key_create(&current_key,ThreadPrivate::destroyFunc))
if (::pthread_key_create(&current_key,ThreadPrivate::destroyFunc)) {
abortOnBug(true);
Debug(DebugFail,"Failed to create current thread key!");
}
}
};