Fix case where all threadpool threads are killed.

This commit is contained in:
Gunnar Beutner 2013-04-05 14:32:16 +02:00
parent 1682ff2839
commit 06839ba4b0
1 changed files with 1 additions and 1 deletions

View 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. */