mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-04 09:09:56 +00:00
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
2fbfa5f862
commit
7ae9a22df2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84610
@ -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