summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-31 13:56:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-31 13:56:42 +0000
commitd4c2cca3cbc8bc9268eac16ca1a071b6c0c920b4 (patch)
tree49b0de5942d15c8cd8f2e521282688ea94f8f74e /thread_pthread.c
parent58d8e1450f5656a41a8e37df76d13d8ab6d251b2 (diff)
downloadruby-d4c2cca3cbc8bc9268eac16ca1a071b6c0c920b4.tar.gz
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@14815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index daeca964a7..962215b1a1 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);