
jmaimon at ttec
Apr 27, 2004, 6:04 PM
Post #1 of 10
(1278 views)
Permalink
|
Hello All, In clamd/server-th.c why do we not wait to call pthread_mutex_unlock until after reload_db? ALSO: Isnt this a call to pthread_mutex_unlock after its already unlocked? pthread_mutex_lock(&reload_mutex); if(reload) { reload = 0; pthread_mutex_unlock(&reload_mutex); /* Destroy the thread manager. * This waits for all current tasks to end */ thrmgr_destroy(thr_pool); root = reload_db(root, copt, FALSE); if((thr_pool=thrmgr_new(max_threads, 30, scanner_thread)) == NULL) { logg("!thrmgr_new failed\n"); pthread_mutex_unlock(&reload_mutex); exit(-1); } #ifdef CLAMUKO if(cfgopt(copt, "ClamukoScanOnLine") || cfgopt(copt, "ClamukoScanOnAccess")) { logg("Stopping and restarting Clamuko.\n"); pthread_kill(clamuko_pid, SIGUSR1); pthread_join(clamuko_pid, NULL); tharg->root = root; pthread_create(&clamuko_pid, &clamuko_attr, clamukoth, tharg); } #endif } else { pthread_mutex_unlock(&reload_mutex); } }
|