X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fthreads.c;h=d995c39826fc5795698bd2793c4c9f74ffa42b0a;hb=6ee6b5fc488f5286ea81ef95503c91c43c434ced;hp=18641b5456491ce4201069b5cd55a64e6403b19c;hpb=fd710adc44e642ad7b62cffbb7114c5b3f82bed4;p=citadel.git diff --git a/citadel/threads.c b/citadel/threads.c index 18641b545..d995c3982 100644 --- a/citadel/threads.c +++ b/citadel/threads.c @@ -1,7 +1,7 @@ /* * Thread handling stuff for Citadel server * - * Copyright (c) 1987-2019 by the citadel.org team + * Copyright (c) 1987-2021 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 3. @@ -53,6 +53,7 @@ int try_critical_section(int which_one) * transaction; this could lead to deadlock. */ if ( (which_one != S_FLOORCACHE) + && (which_one != S_NETCONFIGS) ) { cdb_check_handles(); } @@ -70,6 +71,7 @@ void begin_critical_section(int which_one) * transaction; this could lead to deadlock. */ if ( (which_one != S_FLOORCACHE) + && (which_one != S_NETCONFIGS) ) { cdb_check_handles(); } @@ -142,8 +144,7 @@ void InitializeMasterTSD(void) { /* * Initialize the thread system */ -void go_threading(void) -{ +void go_threading(void) { pthread_mutex_init(&ThreadCountMutex, NULL); /* Second call to module init functions now that threading is up */ @@ -167,11 +168,7 @@ void go_threading(void) CtdlShutdownServiceHooks(); /* close all listener sockets to prevent new connections */ PerformSessionHooks(EVT_SHUTDOWN); /* run any registered shutdown hooks */ - int countdown = 30; - while ( (num_workers > 0) && (countdown-- > 0)) { - syslog(LOG_DEBUG, "Waiting %d seconds for %d worker threads to exit", - countdown, num_workers - ); - usleep(1000000); - } + /* We used to wait for all threads to exit. Fuck that. The only thing important is that the databases are + * cleanly unmounted. After that, exit the whole program. + */ }