Report the number of threads that are to be cancelled at shutdown.

Protect against not cancelling threads if compiling with SOFT_WAITS <= 0.


git-svn-id: http://yate.null.ro/svn/yate/trunk@3386 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2010-06-16 13:45:54 +00:00
parent a412a081e2
commit d8b784be12
1 changed files with 2 additions and 1 deletions

View File

@ -429,6 +429,8 @@ void ThreadPrivate::killall()
ThreadPrivate *t;
bool sledgehammer = false;
s_tmutex.lock();
int c = s_threads.count();
Debug(DebugNote,"Soft cancelling %d running threads",c);
ObjList* l = &s_threads;
while (l && (t = static_cast<ThreadPrivate *>(l->get())) != 0)
{
@ -436,7 +438,6 @@ void ThreadPrivate::killall()
t->cancel(false);
l = l->next();
}
int c;
for (int w = 0; w < SOFT_WAITS; w++) {
s_tmutex.unlock();
Thread::idle();