Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Oct 2005 18:52:44 +0800
From:      David Xu <davidxu@freebsd.org>
To:        David Xu <davidxu@freebsd.org>
Cc:        Alexander Leidinger <Alexander@Leidinger.net>, Poul-Henning Kamp <phk@phk.freebsd.dk>, freebsd-current@freebsd.org, Robert Watson <rwatson@freebsd.org>
Subject:   Re: TSC instead of ACPI: powerd doesn't work anymore (to be expected?)
Message-ID:  <4365F77C.4000702@freebsd.org>
In-Reply-To: <4365F687.3070105@freebsd.org>
References:  <81213.1130754398@critter.freebsd.dk> <4365F687.3070105@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4365F77C.4000702>