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:
deischen 2001-10-07 02:34:43 +00:00
parent ac520683a4
commit 4d56211ce3
3 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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