diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-29 04:18:29 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-04-29 04:18:29 +0000 |
commit | b4c5fad4b1b435f081dd552ad29040a9edb1457f (patch) | |
tree | d594c9bb0ca0953baa3283eb789759c7d8db21c3 /win32 | |
parent | 9d4ae4ab0c5b17e48939457bc9d4cf45ac412d26 (diff) |
* 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
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 10 |
1 files changed, 7 insertions, 3 deletions
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); |