From b4c5fad4b1b435f081dd552ad29040a9edb1457f Mon Sep 17 00:00:00 2001 From: kosaki Date: Fri, 29 Apr 2011 04:18:29 +0000 Subject: * thread_win32.c (native_cond_timedwait): New. r31373 caused win32 build failure. * thread_win32.c (__cond_timedwait, abs_timespec_to_timeout_ms): New helper functions. * win32/win32.c (rb_w32_time_subtract): rename from subtract and remove static. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/win32.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'win32') diff --git a/win32/win32.c b/win32/win32.c index 91dcf24b95..46c57dc47e 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2528,8 +2528,12 @@ do_select(int nfds, fd_set *rd, fd_set *wr, fd_set *ex, return r; } -static inline int -subtract(struct timeval *rest, const struct timeval *wait) +/* + * rest -= wait + * return 0 if rest is smaller than wait. + */ +int +rb_w32_time_subtract(struct timeval *rest, const struct timeval *wait) { if (rest->tv_sec < wait->tv_sec) { return 0; @@ -2668,7 +2672,7 @@ rb_w32_select(int nfds, fd_set *rd, fd_set *wr, fd_set *ex, struct timeval now; gettimeofday(&now, NULL); rest = limit; - if (!subtract(&rest, &now)) break; + if (!rb_w32_time_subtract(&rest, &now)) break; if (compare(&rest, &wait) < 0) dowait = &rest; } Sleep(dowait->tv_sec * 1000 + dowait->tv_usec / 1000); -- cgit v1.2.3