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:
Daniel Eischen 2001-10-07 02:34:43 +00:00
parent 2fbfa5f862
commit 7ae9a22df2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84610
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