summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc_r/uthread/uthread_kern.c3
-rw-r--r--lib/libkse/thread/thr_kern.c3
-rw-r--r--lib/libpthread/thread/thr_kern.c3
3 files changed, 9 insertions, 0 deletions
diff --git a/lib/libc_r/uthread/uthread_kern.c b/lib/libc_r/uthread/uthread_kern.c
index 9d317ed..ec4c233 100644
--- a/lib/libc_r/uthread/uthread_kern.c
+++ b/lib/libc_r/uthread/uthread_kern.c
@@ -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
diff --git a/lib/libkse/thread/thr_kern.c b/lib/libkse/thread/thr_kern.c
index 9d317ed..ec4c233 100644
--- a/lib/libkse/thread/thr_kern.c
+++ b/lib/libkse/thread/thr_kern.c
@@ -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
diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c
index 9d317ed..ec4c233 100644
--- a/lib/libpthread/thread/thr_kern.c
+++ b/lib/libpthread/thread/thr_kern.c
@@ -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
OpenPOWER on IntegriCloud