From dacf3a59a650bf3cbf33443ce52446efd38174c7 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 3 Oct 2004 04:25:23 +0000 Subject: [PATCH] * Removed some vestiges --- citadel/ChangeLog | 4 ++++ citadel/database_sleepycat.c | 6 +++--- citadel/server.h | 1 - citadel/server_main.c | 4 ++-- citadel/sysdep.c | 13 +++---------- citadel/sysdep_decls.h | 1 - 6 files changed, 12 insertions(+), 17 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index f04474641..87dacf52d 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 626.4 2004/10/03 04:25:23 ajc + * Removed some vestiges + Revision 626.3 2004/10/03 04:11:48 ajc * sysdep.c: in the main server loop, when time_to_die is detected, return immediately instead of falling through to the end of the function. @@ -6132,3 +6135,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/database_sleepycat.c b/citadel/database_sleepycat.c index 54a8504d7..18c1f10fc 100644 --- a/citadel/database_sleepycat.c +++ b/citadel/database_sleepycat.c @@ -273,9 +273,9 @@ static void cdb_checkpoint(void) { /* * Open the various databases we'll be using. Any database which - * does not exist should be created. Note that we don't need an S_DATABASE - * critical section here, because there aren't any active threads manipulating - * the database yet -- and besides, it causes problems on BSDI. + * does not exist should be created. Note that we don't need a + * critical section here, because there aren't any active threads + * manipulating the database yet. */ void open_databases(void) { diff --git a/citadel/server.h b/citadel/server.h index 1e9ea667f..2dbfd1882 100644 --- a/citadel/server.h +++ b/citadel/server.h @@ -211,7 +211,6 @@ enum { S_FLOORTAB, S_CHATQUEUE, S_CONTROL, - S_DATABASE, S_NETDB, S_SUPPMSGMAIN, S_CONFIG, diff --git a/citadel/server_main.c b/citadel/server_main.c index 3e51f93ea..6020ebf54 100644 --- a/citadel/server_main.c +++ b/citadel/server_main.c @@ -230,7 +230,6 @@ int main(int argc, char **argv) end_critical_section(S_WORKER_LIST); /* Now this thread can become a worker as well. */ - initial_thread = pthread_self(); worker_thread(NULL); /* Server is exiting. Wait for workers to shutdown. */ @@ -243,8 +242,9 @@ int main(int argc, char **argv) /* avoid deadlock with an exiting thread */ end_critical_section(S_WORKER_LIST); - if ((i = pthread_join(wnp->tid, NULL))) + if ((i = pthread_join(wnp->tid, NULL))) { lprintf(CTDL_CRIT, "pthread_join: %s\n", strerror(i)); + } free(wnp); begin_critical_section(S_WORKER_LIST); } diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 59d349045..c123520af 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -95,8 +95,6 @@ time_t last_purge = 0; /* Last dead session purge */ static int num_threads = 0; /* Current number of threads */ int num_sessions = 0; /* Current number of sessions */ -pthread_t initial_thread; /* tid for main() thread */ - int syslog_facility = (-1); @@ -958,9 +956,8 @@ do_select: force_purge = 0; tv.tv_usec = 0; retval = select(highest + 1, &readfds, NULL, NULL, &tv); } - else { - return; - } + + if (time_to_die) return(NULL); /* Now figure out who made this select() unblock. * First, check for an error or exit condition. @@ -1028,10 +1025,6 @@ do_select: force_purge = 0; } } - if (time_to_die) { - return; - } - /* It must be a client socket. Find a context that has data * waiting on its socket *and* is in the CON_IDLE state. Any * active sockets other than our chosen one are marked as @@ -1084,7 +1077,7 @@ SKIP_SELECT: } /* If control reaches this point, the server is shutting down */ - return NULL; + return(NULL); } diff --git a/citadel/sysdep_decls.h b/citadel/sysdep_decls.h index e0be5f472..fa486391c 100644 --- a/citadel/sysdep_decls.h +++ b/citadel/sysdep_decls.h @@ -73,7 +73,6 @@ extern int num_sessions; extern volatile int time_to_die; extern int verbosity; extern int rescan[]; -extern pthread_t initial_thread; extern struct worker_node { pthread_t tid; -- 2.39.2