From 76d8d49549e381871763c7e9619d07ec52ca9243 Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Fri, 5 Jan 2007 03:33:40 +0000 Subject: * thread_pthread.ci (native_sleep): fix tv_nsec overflow. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ thread_pthread.ci | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0f58a8658..348826991 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Jan 5 12:31:23 2007 GOTOU Yuuzou + + * thread_pthread.ci (native_sleep): fix tv_nsec overflow. + Thu Jan 4 20:01:29 2007 Koichi Sasada * common.mk : rename yarv-test-[all/each] to compare-test[/-each]. diff --git a/thread_pthread.ci b/thread_pthread.ci index df1ed7e5d..3a3249e53 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; -- cgit