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