$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.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
/*
* 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)
{
S_FLOORTAB,
S_CHATQUEUE,
S_CONTROL,
- S_DATABASE,
S_NETDB,
S_SUPPMSGMAIN,
S_CONFIG,
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. */
/* 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);
}
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);
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.
}
}
- 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
}
/* If control reaches this point, the server is shutting down */
- return NULL;
+ return(NULL);
}
extern volatile int time_to_die;
extern int verbosity;
extern int rescan[];
-extern pthread_t initial_thread;
extern struct worker_node {
pthread_t tid;