Fixed a race condition which made the thread pool size unnecessarily large.
authorArt Cancro <ajc@citadel.org>
Mon, 13 Sep 2010 19:19:46 +0000 (15:19 -0400)
committerArt Cancro <ajc@citadel.org>
Mon, 13 Sep 2010 19:19:46 +0000 (15:19 -0400)
webcit/context_loop.c

index 2dd63c9a2efdb551193577e536d64489caa7b04a..266b2f4c7d4a4ffb328bc1dc390236493bec0245 100644 (file)
@@ -114,7 +114,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)
        ) {