From: Art Cancro Date: Mon, 13 Sep 2010 19:19:46 +0000 (-0400) Subject: Fixed a race condition which made the thread pool size unnecessarily large. X-Git-Tag: v7.86~51 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=8dacea4e5ae53b6225ce46778b4d266c59175cb4 Fixed a race condition which made the thread pool size unnecessarily large. --- diff --git a/webcit/context_loop.c b/webcit/context_loop.c index 8559f09b0..b506428b0 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -116,7 +116,7 @@ void check_thread_pool_size(void) if (time_to_die) return; /* don't expand the thread pool during shutdown */ begin_critical_section(S_SPAWNER); /* only one of these should run at a time */ - while ( + if ( (num_threads_executing >= num_threads_existing) && (num_threads_existing < MAX_WORKER_THREADS) ) {