Re: [vox-tech] pthread_cond_timedwait and timespec struct
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vox-tech] pthread_cond_timedwait and timespec struct
- Subject: Re: [vox-tech] pthread_cond_timedwait and timespec struct
- From: Richard Cook <MAPSrcook@llnl.gov>
- Date: Thu, 28 Sep 2000 13:22:25 -0700
- References: Pine.GSO.3.96.1000928112311.639B-100000@wheel.dcn.davis.ca.us
Jeff Newmiller wrote:
>
> On Thu, 28 Sep 2000, Richard Cook wrote:
>
> > Anyone know why pthread_cond_timedwait doesn't seem to wait at all
> > (noone sends a cond_signal) for the following snippet? I guess maybe
> > I'm doing something wrong with TIA
> >
> > struct timespec theTimeSpec = {0};
> > theTimeSpec.tv_sec = 0;
> > theTimeSpec.tv_nsec = 500000000;/* 500.0 milliseconds */
> > err = pthread_cond_timedwait(&pcbReadyForSorter_cond,
> > &sortWaiting_lock,
> > &theTimeSpec);
> >
> > when it returns, err = 147, which I can't seem to find the meaning of.
> > When I try to test (err == ETIMEDOUT), my compiler complains that
> > ETIMEDOUT is not defined. Wasup?
>
> Well, Reading The Fine Manual it says that the time specification must be
> absolute, for one thing. See the example in the man page.
I don't have an example in my man page. Can you send it to me? thx. I
still don't understand what "absolute" means. All time is relative.
(and I'm not just being philosophical here)
>
> As for ETIMEDOUT, the only instance of this macro to be found in my
> include tree is in /usr/include/pi-source.h, which is for Pilot
> programming. I think this is a deficiency in the pthreads library.
I found a definition in /usr/include/sys/errno.h
--
opinions expressed here are not those of my employer!
email: rcook@llnl.gov Rich Cook, Mail Stop L-551 Bldg-3577
Rm-1000
http://www.llnl.gov/graphics Lawrence Livermore National Laboratory
phone (925) 423-9605 (work) 7000 East Avenue
fax (925) 423-9338 Livermore, CA 94550, USA
|