Trog wrote:
On Tue, 2004-04-27 at 16:34, Joe Maimon wrote:You mean it doesnt protect against reload_db being called twice with a possible race.
Hello All,
In clamd/server-th.c why do we not wait to call pthread_mutex_unlock until after reload_db?
Because the 'reload_mutex' mutex protects the variable 'reload'. Thats all.
ALSO: Isnt this a call to pthread_mutex_unlock after its already unlocked?
No.
I dont understand. Calls to pthread_mutex_[un]lock highlighted
*****pthread_mutex_lock(&reload_mutex);*****
if(reload) {
reload = 0;
******pthread_mutex_unlock(&reload_mutex); ****** (would it be better to move this below reload_db?)
/* 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);*******
This unlock? Which lock does it correspond too?
-trog
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Clamav-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-devel
