From d8b784be12b5bccde48a513b17b32f9178bbbac0 Mon Sep 17 00:00:00 2001 From: paulc Date: Wed, 16 Jun 2010 13:45:54 +0000 Subject: [PATCH] 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 --- engine/Thread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/Thread.cpp b/engine/Thread.cpp index 1f964370..d44fc30f 100644 --- a/engine/Thread.cpp +++ b/engine/Thread.cpp @@ -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(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();