On Mon, Jul 22, 2002, Freiman wrote about "posix pthreads":
> Hello!
> I'm trying to develop a project using posix pthreads.
> I'm using x86 with redhat 7.3 ans standart pthreads library, which got with the 
>redhat7.3
> the function: pthread_cond_timedwait return the value 110, which mean the time is 
>over without recive signal, immiedatly, without waiting that time?
> if someone know somthing about it, i'll be thankfull
> Moti

"110" is ETIMEDOUT (see /usr/include/asm/errno.h), which the
pthread_cond_timedwait(3) indeed explains as:

        the condition variable was not signaled until the timeout specified
        by abstime

If you suspect that the function did not sleep as much time as you thought
it should, you probably have misread the manual. Pay attention to two
important issues:

1. The abstime parameter is a "struct timespec", which contains a field
   of seconds and another field of nanoseconds (not microseconds as you
   may have expected).

2. The abstime parameter is, as its name suggests and the manual clearly
   explains, *absolute time*. You don't put there "5 seconds and 17
   microseconds", but rather the time you want to sleep until. You'd
   normally call gettimeofday(), convert the microseconds into nanoseconds,
   add the amount you want to wait, and use that resulting time.
   The manual gives a very detailed example.

If neither of these is your problem, than please show us a piece of your
code if you want use to have a better clue rather than just make guesses
on what your problem is, and what your experience level (to use Rogue-speak)
is.

-- 
Nadav Har'El                        |      Tuesday, Oct 1 2002, 25 Tishri 5763
[EMAIL PROTECTED]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |It's no use crying over spilt milk -- it
http://nadav.harel.org.il           |only makes it salty for the cat.

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to