Bug in sem_timedwait()

Peter Dufault dufault at hda.com
Mon May 23 19:39:23 UTC 2005


There is a bug in the POSIX sem_timedwait() implementation.  The  
struct timespec() is supposed to be an absolute timeout but it is  
implemented as a relative timeout.  The same code that is in  
condtimedwait() (or even better, extract that code to a single place)  
needs to be put in there.

Also, sem_timedwait needs to obey the rule that the timeout need not  
be valid if the semaphore can be locked immediately.  I didn't check  
that.

I'll open a bug report.  I don't think bug reports are sent to the  
list so I posted this as well.

Peter



More information about the users mailing list