sleep() isn't defined to be per thread; use usleep() instead which is.
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 21 Feb 2012 22:46:41 +0000 (23:46 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 21 Feb 2012 22:46:41 +0000 (23:46 +0100)
citadel/threads.c

index 59aae25d27f88bd44e3d1749ed75875ce3967421..a9fce4eb471282f59e5cbaf1ff5831496e9c3237 100644 (file)
@@ -207,7 +207,7 @@ void go_threading(void)
                if ((active_workers == num_workers) && (num_workers < 256)) {
                        CtdlThreadCreate(worker_thread);
                }
-               sleep(1);
+               usleep(1000);
        }
 
        /* When we get to this point we are getting ready to shut down our Citadel server */
@@ -221,6 +221,6 @@ void go_threading(void)
                syslog(LOG_DEBUG, "Waiting %d seconds for %d worker threads to exit",
                        countdown, num_workers
                );
-               sleep(1);
+               usleep(1000);
        }
 }