David Xu wrote: > > In thread program, we have to use clock_gettime, for example a thread > wants to wait for condition variable for two seconds, it has to: > > struct timespec ts; > > clock_gettime(CLOCK_REALTIME, &ts); > ts.tv_sec += 2; > pthread_cond_wait(&cond, &mtx); > Should be: pthread_cond_timedwait(&cond, &mtx, &ts);Received on Mon Oct 31 2005 - 09:52:44 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:46 UTC