Fixed a race condition which made the thread pool size unnecessarily large.
[citadel.git] / webcit / context_loop.c
index 8559f09b02006b489f794ebe567d569a9124d1cb..b506428b02387551563e337fdebb50da2dea5318 100644 (file)
@@ -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)
        ) {