Trog wrote:
On Wed, 2004-04-28 at 12:46, Joe Maimon wrote:Thanks for the thought food,
I suppose by having thrmgr_destroy(thr_pool); wait for all worker threads to finish?
Yes.
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?
Yes, it would. And that would be a bug in the scanning engine.
2 more Questions.
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?
No, because you only read the man page for a particular implementation. Other implementations can return an error.
2) Why do an "if" and then also a "while" on the same variable?
Because thats a fundamental rule of using condition variables. To protect against spurious wakeups.
-trog
Your, 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
