summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2005-02-18 16:07:05 +0000
committerdeischen <deischen@FreeBSD.org>2005-02-18 16:07:05 +0000
commitd249e2f25d104c99f8b1e12673f53203d6c2f51d (patch)
tree1548acddee9de47da63f6cb6f23034910d1734df /lib/libpthread/thread
parent0c6289b326e3c9c97bb3fc8229f6893e40caf5de (diff)
downloadFreeBSD-src-d249e2f25d104c99f8b1e12673f53203d6c2f51d.zip
FreeBSD-src-d249e2f25d104c99f8b1e12673f53203d6c2f51d.tar.gz
Somewhere along the line, tick accumulation for SA threads was
changed to use the statclock. Make sure we calculate the value of a tick correctly in userland. Noticed by: Kazuaki Oda <kaakun at highway dot ne dot jp>
Diffstat (limited to 'lib/libpthread/thread')
-rw-r--r--lib/libpthread/thread/thr_init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c
index f963789..c143627 100644
--- a/lib/libpthread/thread/thr_init.c
+++ b/lib/libpthread/thread/thr_init.c
@@ -421,7 +421,7 @@ init_private(void)
mib[1] = KERN_CLOCKRATE;
len = sizeof (struct clockinfo);
if (sysctl(mib, 2, &clockinfo, &len, NULL, 0) == 0)
- _clock_res_usec = clockinfo.tick;
+ _clock_res_usec = 1000000 / clockinfo.stathz;
else
_clock_res_usec = CLOCK_RES_USEC;
OpenPOWER on IntegriCloud