Limit threads clock resolution to no less than 1000usec (1000Hz).
PR: 25300 Submitted by: Tom Pavel <pavel@alum.mit.edu> (in part)
This commit is contained in:
parent
868cd470b4
commit
d9ad338640
@ -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.
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user