On Wed, 2004-04-28 at 12:46, Joe Maimon wrote: > > > 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
signature.asc
Description: This is a digitally signed message part
