TSC instead of ACPI: powerd doesn't work anymore (to be
expected?)
David Xu
davidxu at freebsd.org
Mon Oct 31 02:52:44 PST 2005
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);
More information about the freebsd-current
mailing list