diff --git a/ChangeLog b/ChangeLog index f79f0995b6..33b796e2ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon Dec 31 22:53:29 2007 Yukihiro Matsumoto + + * thread_pthread.c (native_sleep): timespec tv_sec may overflow on + some platform. a patch from zunda in + [ruby-dev:32904]. + Mon Dec 31 19:35:20 2007 Tanaka Akira * string.c (IS_7BIT): removed. 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);