X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fsysdep.c;h=ee75bb9cba43be769faad5ded733dffbc7001f46;hb=2c9048572f22002cd287cd3137b5f7461d35455b;hp=c3bbd7ad653860b993e487b620e3471511edccd1;hpb=ffa2f0d76075e6e404b050b340307affcf8cd79b;p=citadel.git diff --git a/citadel/sysdep.c b/citadel/sysdep.c index c3bbd7ad6..ee75bb9cb 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -1143,6 +1143,8 @@ void *worker_thread(void *blah) { struct timeval tv; int force_purge = 0; + ++num_workers; + while (!CtdlThreadCheckStop()) { /* make doubly sure we're not holding any stale db handles @@ -1259,6 +1261,7 @@ do_select: force_purge = 0; SKIP_SELECT: /* We're bound to a session */ + ++active_workers; if (bind_me != NULL) { become_session(bind_me); @@ -1292,6 +1295,7 @@ SKIP_SELECT: dead_session_purge(force_purge); do_housekeeping(); + --active_workers; } /* If control reaches this point, the server is shutting down */ return(NULL);