]> granicus.if.org Git - icinga2/commitdiff
Fix case where all threadpool threads are killed.
authorGunnar Beutner <gunnar@beutner.name>
Fri, 5 Apr 2013 12:32:16 +0000 (14:32 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Fri, 5 Apr 2013 12:32:16 +0000 (14:32 +0200)
lib/base/threadpool.cpp

index a789929840b3cb1d44b491ddb7e1f904d453da7e..6627906da91d441f69c96c613647429473e61567 100644 (file)
@@ -228,7 +228,7 @@ void ThreadPool::ManagerThreadProc(void)
                        else
                                avg_latency = 0;
 
-                       if (utilization < 60 || utilization > 80) {
+                       if (utilization < 60 || utilization > 80 || alive < 2) {
                                int tthreads = ceil((utilization * alive) / 80.0) - alive;
 
                                /* Don't ever kill the last 2 threads. */