From dev-return-6906-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Tue Jul 02 15:22:55 2002 Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 89358 invoked by uid 500); 2 Jul 2002 15:22:55 -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 89347 invoked from network); 2 Jul 2002 15:22:55 -0000 Date: Tue, 02 Jul 2002 08:23:32 -0700 From: Brian Pane Subject: Re: watch out for thread_cond_timedwait problems In-reply-to: To: Jeff Trawick Cc: dev@apr.apache.org Message-id: <1025623412.3126.15.camel@localhost> MIME-version: 1.0 X-Mailer: Ximian Evolution 1.0.3 (1.0.3-6) Content-type: text/plain Content-transfer-encoding: 7BIT References: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Tue, 2002-07-02 at 08:01, Jeff Trawick wrote: > Jeff Trawick writes: > > > I dunno what the cause is yet, but I'm getting testlock failures for > > the last day or so. > > > > Tru64: > > > > thread_cond_timedwait Tests > > Initializing the first apr_thread_mutex_t OK > > Initializing the apr_thread_cond_t OK > > Waiting for condition for 5 seconds Failed! (bad timer) > > stderr: > > thread_cond_timedwait test failed : [22] Invalid argument > > (dbx) n > thread 0xc [apr_thread_cond_timedwait:139 ,0x3ffbfff21fc] > Source not available > (dbx) p abstime > struct { > tv_sec = 1025619886 > tv_nsec = -453280000 > } > (dbx) Do you get a correct tv_nsec if you remove the cast to 32-bit int in the apr_time_usec macro? --Brian Index: apr/include/apr_time.h =================================================================== RCS file: /home/cvs/apr/include/apr_time.h,v retrieving revision 1.53 diff -u -r1.53 apr_time.h --- apr/include/apr_time.h 12 Jun 2002 22:23:56 -0000 1.53 +++ apr/include/apr_time.h 2 Jul 2002 15:21:05 -0000 @@ -95,7 +95,7 @@ /** number of microseconds per second */ #define APR_USEC_PER_SEC APR_TIME_C(1000000) -#define apr_time_usec(time) ((apr_int32_t)(time) % APR_USEC_PER_SEC) +#define apr_time_usec(time) ((time) % APR_USEC_PER_SEC) #define apr_time_sec(time) ((apr_int64_t)(time) / APR_USEC_PER_SEC)