void begin_critical_section(int which_one)
{
/* lprintf(9, "begin_critical_section(%d)\n", which_one); */
+ /* ensure nobody ever tries to do a critical section within a
+ transaction; this could lead to deadlock. */
+ cdb_check_handles();
pthread_mutex_lock(&Critters[which_one]);
}
int retval;
int sock;
+
if (CC->redirect_fp != NULL) {
fwrite(buf, nbytes, 1, CC->redirect_fp);
return;
/* Tell 'em who's in da house */
lprintf(1,
"\nMultithreaded message server for Citadel/UX\n"
-"Copyright (C) 1987-2000 by the Citadel/UX development team.\n"
+"Copyright (C) 1987-2001 by the Citadel/UX development team.\n"
"Citadel/UX is free software, covered by the GNU General Public License, and\n"
"you are welcome to change it and/or distribute copies of it under certain\n"
"conditions. There is absolutely no warranty for this software. Please\n"
/* make doubly sure we're not holding any stale db handles
* which might cause a deadlock.
*/
- cdb_release_handles();
+ cdb_check_handles();
begin_critical_section(S_I_WANNA_SELECT);
SETUP_FD: memcpy(&readfds, &masterfds, sizeof masterfds);
dead_session_purge();
if ((time(NULL) - last_timer) > 60L) {
last_timer = time(NULL);
- cdb_release_handles(); /* suggested by Justin Case */
+ cdb_check_handles(); /* suggested by Justin Case */
PerformSessionHooks(EVT_TIMER);
}