summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authorDaniel Eischen <deischen@FreeBSD.org>2001-02-26 01:05:33 +0000
committerDaniel Eischen <deischen@FreeBSD.org>2001-02-26 01:05:33 +0000
commitc6f2aed1029befe1f0e3d8a355ef7fa7500a39b3 (patch)
tree58ba92e042d07c4568dbd4fad472abc4df20aeba /lib/libpthread
parenta68886ad5175cf5e86e9164741e2d1d22e2aee07 (diff)
Notes
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/thread/thr_init.c3
-rw-r--r--lib/libpthread/thread/thr_private.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c
index c92efe3e8595..80ec23147e16 100644
--- a/lib/libpthread/thread/thr_init.c
+++ b/lib/libpthread/thread/thr_init.c
@@ -414,7 +414,8 @@ _thread_init(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 = clockinfo.tick > CLOCK_RES_USEC_MIN ?
+ clockinfo.tick : CLOCK_RES_USEC_MIN;
/* Get the table size: */
if ((_thread_dtablesize = getdtablesize()) < 0) {
diff --git a/lib/libpthread/thread/thr_private.h b/lib/libpthread/thread/thr_private.h
index 7a37de8957b3..8e04bd5bb146 100644
--- a/lib/libpthread/thread/thr_private.h
+++ b/lib/libpthread/thread/thr_private.h
@@ -459,6 +459,7 @@ enum pthread_susp {
* Clock resolution in microseconds.
*/
#define CLOCK_RES_USEC 10000
+#define CLOCK_RES_USEC_MIN 1000
/*
* Time slice period in microseconds.