Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 50154 invoked from network); 9 Dec 2003 11:07:32 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 9 Dec 2003 11:07:32 -0000 Received: (qmail 1734 invoked by uid 500); 9 Dec 2003 11:07:04 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 1652 invoked by uid 500); 9 Dec 2003 11:07:03 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 1633 invoked from network); 9 Dec 2003 11:07:03 -0000 Message-ID: <3FD5AC73.3080309@attglobal.net> Date: Tue, 09 Dec 2003 06:05:23 -0500 From: Jeff Trawick Reply-To: trawick@attglobal.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@apr.apache.org Subject: Re: REPOST: [PATCH] add timeout to apr_reslist References: <20031208192257.9E6088CFB8@mailhub.mail.Virginia.EDU> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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. agreed > 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?