mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
3e5b3dac1f
commit
76ddb7e7ac
2 changed files with 8 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Fri Jan 5 12:31:23 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||||
|
|
||||||
|
* thread_pthread.ci (native_sleep): fix tv_nsec overflow.
|
||||||
|
|
||||||
Thu Jan 4 20:01:29 2007 Koichi Sasada <ko1@atdot.net>
|
Thu Jan 4 20:01:29 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* common.mk : rename yarv-test-[all/each] to compare-test[/-each].
|
* common.mk : rename yarv-test-[all/each] to compare-test[/-each].
|
||||||
|
|
|
@ -254,6 +254,10 @@ native_sleep(yarv_thread_t *th, struct timeval *tv)
|
||||||
gettimeofday(&tvn, NULL);
|
gettimeofday(&tvn, NULL);
|
||||||
ts.tv_sec = tvn.tv_sec + tv->tv_sec;
|
ts.tv_sec = tvn.tv_sec + tv->tv_sec;
|
||||||
ts.tv_nsec = (tvn.tv_usec + tv->tv_usec) * 1000;
|
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;
|
th->status = THREAD_STOPPED;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue