Subj : Re: pthread_timed_wait To : comp.programming.threads From : Maciej Sobczak Date : Wed Jun 01 2005 06:44 pm Michael H Lees wrote: > However, I don't know if it's my implementation but if I call timed wait > with a time in the past the function returns EINVAL. If this is really true, then this is a bug in the implementation. The reason is that for any timeout value, every call to the wait function could be already late - this is because some other thread might take over the CPU *before* you call the wait function and for the time long enough to make your timeout already in the past. > Is a abstime less than the system time an invalid time? Certainly not, for the above reasons. On my machine (kernel 2.4) the pthread_cond_timedwait returns ETIMEDOUT when the given time was already in the past. -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/ .