Trog wrote:
On Wed, 2004-04-28 at 12:14, Joe Maimon wrote:I suppose by having thrmgr_destroy(thr_pool); wait for all worker threads to finish?
It would make sense to suppose that steps were taken to ensure there was only one thread executing reload_db with do_check == FALSE ?
It would make sense, which is why it is currently implemented that way.
-trog
If a thread refused to finish at that time would thrmgr_destroy not return and clamd stop doing any more work even after accepting socket connections?
2 more Questions.
from clamd/thrmgr.c in thrmgr_destroy()
/* wait for threads to exit */
if (threadpool->thr_alive > 0) {
if (pthread_cond_broadcast(&(threadpool->pool_cond)) != 0) {
pthread_mutex_unlock(&threadpool->pool_mutex);
return;
}
}
while (threadpool->thr_alive > 0) {
if (pthread_cond_wait (&threadpool->pool_cond, &threadpool->pool_mutex) != 0) {
pthread_mutex_unlock(&threadpool->pool_mutex);
return;
}
}
1) man pthread_cond_broadcast states
RETURN VALUE
All condition variable functions return 0 on success and a non-zero error code on error.
ERRORS
pthread_cond_init, pthread_cond_signal, pthread_cond_broadcast, and pthread_cond_wait never return an
error code.
Does that mean that " if (pthread_cond_broadcast(&(threadpool->pool_cond)) != 0) { " will never be true?
2) Why do an "if" and then also a "while" on the same variable?
Thanks for your patience,
Joe
-------------------------------------------------------
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
