Subj : Re: pthread_cond_timedwait problems To : comp.programming.threads From : David Schwartz Date : Sat Aug 13 2005 07:50 pm wrote in message news:1123961265.707957.37810@g47g2000cwa.googlegroups.com... > Whats going on here???? I don't see anything wrong with the program. > Is there something wrong here with this code or is a BUG?? There are two obvious bugs: 1) You just add the number of nanoseconds you want to wait to the current time. This can cause serious problems. For example, if it's 8:53 and you want to wait for 10 minutes, you don't want to wait until 8:63, do you? 2) You call pthread_cond_timedwait without holding the associated mutex. So what's supposed to happen when pthread_cond_timedwait tries to release the mutex before it waits? DS .