From: Wilfried Goesgens Date: Sun, 16 Sep 2012 14:59:36 +0000 (+0200) Subject: Upsie, usleep is 10^6 times smaller than sleep X-Git-Tag: v8.20~230 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=5365493a013629f909c27528febb9660e5d1d863 Upsie, usleep is 10^6 times smaller than sleep --- diff --git a/citadel/citserver.c b/citadel/citserver.c index 211cefe88..0c8955a8a 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -216,7 +216,7 @@ void master_cleanup(int exitcode) { struct CleanupFunctionHook *fcn; static int already_cleaning_up = 0; - if (already_cleaning_up) while(1) usleep(1000); + if (already_cleaning_up) while(1) usleep(1000000); already_cleaning_up = 1; /* Run any cleanup routines registered by loadable modules */ diff --git a/citadel/threads.c b/citadel/threads.c index ec8fc3feb..4a4fe5163 100644 --- a/citadel/threads.c +++ b/citadel/threads.c @@ -204,7 +204,7 @@ void go_threading(void) if ((active_workers == num_workers) && (num_workers < 256)) { CtdlThreadCreate(worker_thread); } - usleep(1000); + usleep(1000000); } /* When we get to this point we are getting ready to shut down our Citadel server */ @@ -214,7 +214,7 @@ void go_threading(void) ShutDownEventQueues(); } while (!EVQShutDown) - usleep(1000); + usleep(1000000); terminate_all_sessions(); /* close all client sockets */ @@ -226,6 +226,6 @@ void go_threading(void) syslog(LOG_DEBUG, "Waiting %d seconds for %d worker threads to exit", countdown, num_workers ); - usleep(1000); + usleep(1000000); } }