]> code.citadel.org Git - citadel.git/blobdiff - citadel/sysdep.c
TDAP: add facility to protect usetable entries from being deleted while still needed.
[citadel.git] / citadel / sysdep.c
index 4ea07f3edcd95ffc34802439689098d83d7245c8..a6b225fea270e67b5a452a268242af7ddfe6a2f0 100644 (file)
@@ -979,6 +979,7 @@ void sysdep_master_cleanup(void) {
        CtdlDestroyCleanupHooks();
        CtdlDestroyFixedOutputHooks();  
        CtdlDestroySessionHooks();
+       CtdlDestroyTDAPVetoHooks();
        CtdlDestroyServiceHook();
        CtdlDestroyRoomHooks();
        CtdlDestroySearchHooks();
@@ -1381,7 +1382,8 @@ SKIP_SELECT:
 
                pthread_mutex_lock(&ThreadCountMutex);
                --active_workers;
-               if (active_workers + config.c_min_workers < num_workers)
+               if ((active_workers + config.c_min_workers < num_workers) &&
+                   (num_workers > config.c_min_workers))
                {
                        num_workers--;
                        pthread_mutex_unlock(&ThreadCountMutex);