Limit maximum poll interval to 60 seconds. This prevents an overflow
from occurring when converting from a timeval/timespec to a timeout in milliseconds. Submitted by: dwmalone
This commit is contained in:
parent
ac520683a4
commit
4d56211ce3
@ -716,6 +716,9 @@ thread_kern_poll(int wait_reqd)
|
||||
*/
|
||||
timeout_ms = INFTIM;
|
||||
}
|
||||
else if (pthread->wakeup_time.tv_sec - ts.tv_sec > 60000)
|
||||
/* Limit maximum timeout to prevent rollover. */
|
||||
timeout_ms = 60000;
|
||||
else {
|
||||
/*
|
||||
* Calculate the time left for the next thread to
|
||||
|
@ -716,6 +716,9 @@ thread_kern_poll(int wait_reqd)
|
||||
*/
|
||||
timeout_ms = INFTIM;
|
||||
}
|
||||
else if (pthread->wakeup_time.tv_sec - ts.tv_sec > 60000)
|
||||
/* Limit maximum timeout to prevent rollover. */
|
||||
timeout_ms = 60000;
|
||||
else {
|
||||
/*
|
||||
* Calculate the time left for the next thread to
|
||||
|
@ -716,6 +716,9 @@ thread_kern_poll(int wait_reqd)
|
||||
*/
|
||||
timeout_ms = INFTIM;
|
||||
}
|
||||
else if (pthread->wakeup_time.tv_sec - ts.tv_sec > 60000)
|
||||
/* Limit maximum timeout to prevent rollover. */
|
||||
timeout_ms = 60000;
|
||||
else {
|
||||
/*
|
||||
* Calculate the time left for the next thread to
|
||||
|
Loading…
Reference in New Issue
Block a user