#ifdef HAVE_THREADS
pthread_mutex_t cache_sync;
pthread_mutex_t whohandler_sync, whohandler_mass_sync;
-static pthread_mutex_t log_sync;
static pthread_t *current_threads = NULL;
#endif
fprintf(pidfile, "%i\n", (int)getpid());
fclose(pidfile);
}
- FILE *retn;
- fclose(stdin); retn = fopen("/dev/null", "r");
- fclose(stdout); retn = fopen("/dev/null", "w");
- fclose(stderr); retn = fopen("/dev/null", "w");
+ fclose(stdin); fopen("/dev/null", "r");
+ fclose(stdout); fopen("/dev/null", "w");
+ fclose(stderr); fopen("/dev/null", "w");
#endif
}
initMemoryDebug();
#endif
+ //initialize mutex debugger BEFORE using any mutexes
+ #ifdef ENABLE_MUTEX_DEBUG
+ initMutexDebug();
+ #endif
+
//deny root startup
#ifndef WIN32
if(geteuid() == 0 || getuid() == 0) {
free(modulelist);
#if HAVE_THREADS
- THREAD_MUTEX_INIT(log_sync);
THREAD_MUTEX_INIT(cache_sync);
THREAD_MUTEX_INIT(whohandler_sync);
THREAD_MUTEX_INIT(whohandler_mass_sync);