When compiled for debugging warn if a thread calls idle() holding mutex locks.

git-svn-id: http://yate.null.ro/svn/yate/trunk@2831 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2009-09-10 18:59:05 +00:00
parent 3666da4a2d
commit fb6762b981
1 changed files with 6 additions and 0 deletions

View File

@ -653,6 +653,12 @@ void Thread::yield(bool exitCheck)
void Thread::idle(bool exitCheck)
{
#ifdef DEBUG
const Thread* t = Thread::current();
if (t && t->locked())
Debug(DebugMild,"Thread '%s' idling with %d mutex locks held [%p]",
t->name(),t->locks(),t);
#endif
msleep(THREAD_IDLE_MSEC,exitCheck);
}