* 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]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
268f95bdc6
commit
f82a6840a8
@ -1,3 +1,11 @@
|
|||||||
|
Fri May 21 01:06:05 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@tsg.ne.jp>
|
Thu May 20 22:49:04 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||||
|
|
||||||
* re.c (rb_reg_s_union_m): update rdoc. [ruby-dev:41354]
|
* re.c (rb_reg_s_union_m): update rdoc. [ruby-dev:41354]
|
||||||
|
5
thread.c
5
thread.c
@ -2411,6 +2411,9 @@ cmp_tv(const struct timeval *a, const struct timeval *b)
|
|||||||
static int
|
static int
|
||||||
subtract_tv(struct timeval *rest, const struct timeval *wait)
|
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) {
|
while (rest->tv_usec < wait->tv_usec) {
|
||||||
if (rest->tv_sec <= wait->tv_sec) {
|
if (rest->tv_sec <= wait->tv_sec) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -2420,7 +2423,7 @@ subtract_tv(struct timeval *rest, const struct timeval *wait)
|
|||||||
}
|
}
|
||||||
rest->tv_sec -= wait->tv_sec;
|
rest->tv_sec -= wait->tv_sec;
|
||||||
rest->tv_usec -= wait->tv_usec;
|
rest->tv_usec -= wait->tv_usec;
|
||||||
return 1;
|
return rest->tv_sec != 0 || rest->tv_usec != 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2471,7 +2471,7 @@ subtract(struct timeval *rest, const struct timeval *wait)
|
|||||||
}
|
}
|
||||||
rest->tv_sec -= wait->tv_sec;
|
rest->tv_sec -= wait->tv_sec;
|
||||||
rest->tv_usec -= wait->tv_usec;
|
rest->tv_usec -= wait->tv_usec;
|
||||||
return 1;
|
return rest->tv_sec != 0 || rest->tv_usec != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user