From: Alan T. DeKok Date: Mon, 14 Feb 2011 14:27:40 +0000 (+0100) Subject: Suppress messages if thread pool is ~full. X-Git-Tag: release_2_1_11~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f007c1ecc93b8cc38bb7aca49c6cff8f1d8c097;p=thirdparty%2Ffreeradius-server.git Suppress messages if thread pool is ~full. If it's full and all threads are buys, we shouldn't try to create spare threads. --- diff --git a/src/main/threads.c b/src/main/threads.c index e0655204cfe..c19101afa06 100644 --- a/src/main/threads.c +++ b/src/main/threads.c @@ -939,9 +939,14 @@ static void thread_pool_manage(time_t now) /* * If there are too few spare threads. Go create some more. */ - if (spare < thread_pool.min_spare_threads) { + if ((thread_pool.total_threads < thread_pool.max_threads) && + (spare < thread_pool.min_spare_threads)) { total = thread_pool.min_spare_threads - spare; + if ((total + thread_pool.total_threads) > thread_pool.max_threads) { + total = thread_pool.max_threads - thread_pool.total_threads; + } + DEBUG2("Threads: Spawning %d spares", total); /*