summaryrefslogtreecommitdiff
path: root/thread_pthread.ci
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-05 03:33:40 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-05 03:33:40 +0000
commit76ddb7e7acfbef1b402e4e9bc83e85eee213d385 (patch)
tree65a41e7ba40eb04028a01910dc8c47975fc3109d /thread_pthread.ci
parent3e5b3dac1f3b847161fa914f3e4cb3e85198c4a4 (diff)
* thread_pthread.ci (native_sleep): fix tv_nsec overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.ci')
-rw-r--r--thread_pthread.ci4
1 files changed, 4 insertions, 0 deletions
diff --git a/thread_pthread.ci b/thread_pthread.ci
index df1ed7e5d4..3a3249e531 100644
--- a/thread_pthread.ci
+++ b/thread_pthread.ci
@@ -254,6 +254,10 @@ native_sleep(yarv_thread_t *th, struct timeval *tv)
gettimeofday(&tvn, NULL);
ts.tv_sec = tvn.tv_sec + tv->tv_sec;
ts.tv_nsec = (tvn.tv_usec + tv->tv_usec) * 1000;
+ if (ts.tv_nsec >= 1000000000){
+ ts.tv_sec += 1;
+ ts.tv_nsec -= 1000000000;
+ }
}
th->status = THREAD_STOPPED;