ruby-changes:16026
From: yugui <ko1@a...>
Date: Sun, 23 May 2010 21:19:05 +0900 (JST)
Subject: [ruby-changes:16026] Ruby:r27975 (ruby_1_9_2): merges r27930 from trunk into ruby_1_9_2.
yugui 2010-05-23 21:18:44 +0900 (Sun, 23 May 2010) New Revision: 27975 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27975 Log: merges r27930 from trunk into ruby_1_9_2. -- * thread.c (subtract_tv): if the rest is zero, should finish waiting immediately. * win32/win32.c (subtract): ditto. based on a patch from Roger Pack in [ruby-core:27957]. Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/thread.c branches/ruby_1_9_2/win32/win32.c Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 27974) +++ ruby_1_9_2/ChangeLog (revision 27975) @@ -1,3 +1,11 @@ +Fri May 21 01:06:05 2010 NAKAMURA Usaku <usa@r...> + + * thread.c (subtract_tv): if the rest is zero, should finish waiting + immediately. + + * win32/win32.c (subtract): ditto. + based on a patch from Roger Pack in [ruby-core:27957]. + Thu May 20 22:49:04 2010 Yusuke Endoh <mame@t...> * re.c (rb_reg_s_union_m): update rdoc. [ruby-dev:41354] Index: ruby_1_9_2/thread.c =================================================================== --- ruby_1_9_2/thread.c (revision 27974) +++ ruby_1_9_2/thread.c (revision 27975) @@ -2411,6 +2411,9 @@ static int subtract_tv(struct timeval *rest, const struct timeval *wait) { + if (rest->tv_sec < wait->tv_sec) { + return 0; + } while (rest->tv_usec < wait->tv_usec) { if (rest->tv_sec <= wait->tv_sec) { return 0; @@ -2420,7 +2423,7 @@ } rest->tv_sec -= wait->tv_sec; rest->tv_usec -= wait->tv_usec; - return 1; + return rest->tv_sec != 0 || rest->tv_usec != 0; } #endif Index: ruby_1_9_2/win32/win32.c =================================================================== --- ruby_1_9_2/win32/win32.c (revision 27974) +++ ruby_1_9_2/win32/win32.c (revision 27975) @@ -2467,7 +2467,7 @@ } rest->tv_sec -= wait->tv_sec; rest->tv_usec -= wait->tv_usec; - return 1; + return rest->tv_sec != 0 || rest->tv_usec != 0; } static inline int -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/