apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: REPOST: [PATCH] add timeout to apr_reslist
Date Tue, 09 Dec 2003 11:05:23 GMT
Cliff Woolley wrote:

> On Mon, 8 Dec 2003, Mladen Turk wrote:
>>Can someone review this patch and eventually respond if there are
>>any chances to get this patch committed to apr-util.
>>If not we'll make something different then.

+1 (concept)

> I think it would have to be called apr_reslist_timeout_set() rather than
> apr_reslist_set_timeout(), but in general I'm not opposed.


> In this block:
> +        if (reslist->timeout) {
> +            if (apr_thread_cond_timedwait(reslist->avail,
> +                reslist->listlock, reslist->timeout) != APR_SUCCESS)
> +                apr_thread_mutex_unlock(reslist->listlock);
> +                return APR_EAGAIN;
> +        }
> Is it really correct to return APR_EAGAIN regardless of the return value
> of apr_thread_cond_timedwait()?  Or is that a bug caused by a lack of
> {}'s?  This is why we tend to say that you should always use {}'s, even if
> the conditional block is only one line long.

if not returning whatever apr_thread_cond_timedwait() returned, why not return 
APR_TIMEUP instead of APR_EAGAIN?  but like Cliff said I wonder why the retval 
of apr_thread_cond_timewait() isn't appropriate?

View raw message