summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc_r/uthread/pthread_private.h1
-rw-r--r--lib/libc_r/uthread/uthread_init.c3
-rw-r--r--lib/libkse/thread/thr_init.c3
-rw-r--r--lib/libkse/thread/thr_private.h1
-rw-r--r--lib/libpthread/thread/thr_init.c3
-rw-r--r--lib/libpthread/thread/thr_private.h1
6 files changed, 9 insertions, 3 deletions
diff --git a/lib/libc_r/uthread/pthread_private.h b/lib/libc_r/uthread/pthread_private.h
index 7a37de8..8e04bd5 100644
--- a/lib/libc_r/uthread/pthread_private.h
+++ b/lib/libc_r/uthread/pthread_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.
diff --git a/lib/libc_r/uthread/uthread_init.c b/lib/libc_r/uthread/uthread_init.c
index c92efe3..80ec231 100644
--- a/lib/libc_r/uthread/uthread_init.c
+++ b/lib/libc_r/uthread/uthread_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/libkse/thread/thr_init.c b/lib/libkse/thread/thr_init.c
index c92efe3..80ec231 100644
--- a/lib/libkse/thread/thr_init.c
+++ b/lib/libkse/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/libkse/thread/thr_private.h b/lib/libkse/thread/thr_private.h
index 7a37de8..8e04bd5 100644
--- a/lib/libkse/thread/thr_private.h
+++ b/lib/libkse/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.
diff --git a/lib/libpthread/thread/thr_init.c b/lib/libpthread/thread/thr_init.c
index c92efe3..80ec231 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 7a37de8..8e04bd5 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.
OpenPOWER on IntegriCloud