diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-31 13:56:42 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-31 13:56:42 +0000 |
| commit | 7d09b9d1449dddc36a8c8830ce20c8a6e2e71585 (patch) | |
| tree | 49b0de5942d15c8cd8f2e521282688ea94f8f74e | |
| parent | 13872c8da1653ba564cee10de639f7cec643f8da (diff) | |
| download | ruby-7d09b9d1449dddc36a8c8830ce20c8a6e2e71585.tar.gz ruby-7d09b9d1449dddc36a8c8830ce20c8a6e2e71585.tar.xz ruby-7d09b9d1449dddc36a8c8830ce20c8a6e2e71585.zip | |
* thread_pthread.c (native_sleep): timespec tv_sec may overflow on
some platform. a patch from zunda <zunda616e AT yahoo.co.jp> in
[ruby-dev:32904].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | thread_pthread.c | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Mon Dec 31 22:53:29 2007 Yukihiro Matsumoto <matz@ruby-lang.org> + + * thread_pthread.c (native_sleep): timespec tv_sec may overflow on + some platform. a patch from zunda <zunda616e AT yahoo.co.jp> in + [ruby-dev:32904]. + Mon Dec 31 19:35:20 2007 Tanaka Akira <akr@fsij.org> * string.c (IS_7BIT): removed. diff --git a/thread_pthread.c b/thread_pthread.c index daeca964a..962215b1a 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -432,7 +432,7 @@ native_sleep(rb_thread_t *th, struct timeval *tv) thread_debug("native_sleep: interrupted before sleep\n"); } else { - if (tv == 0) { + if (tv == 0 || ts.tv_sec < tvn.tv_sec /* overflow */ ) { thread_debug("native_sleep: pthread_cond_wait start\n"); pthread_cond_wait(&th->native_thread_data.sleep_cond, &th->interrupt_lock); |
