ruby-changes:15802
From: usa <ko1@a...>
Date: Tue, 11 May 2010 14:10:19 +0900 (JST)
Subject: [ruby-changes:15802] Ruby:r27732 (ruby_1_9_2): merge from trunk (r27718)
usa 2010-05-11 14:09:59 +0900 (Tue, 11 May 2010) New Revision: 27732 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27732 Log: merge from trunk (r27718) * win32/win32.c, include/ruby/win32.h (rb_w32_has_cancel_io): new function. * io.c (WAIT_FD_IN_WIN32): check only when it's not cancelable. Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/include/ruby/win32.h branches/ruby_1_9_2/io.c branches/ruby_1_9_2/win32/win32.c Index: ruby_1_9_2/include/ruby/win32.h =================================================================== --- ruby_1_9_2/include/ruby/win32.h (revision 27731) +++ ruby_1_9_2/include/ruby/win32.h (revision 27732) @@ -222,6 +222,7 @@ extern int rb_w32_cmdvector(const char *, char ***); extern rb_pid_t rb_w32_pipe_exec(const char *, const char *, int, int *, int *); extern int flock(int fd, int oper); +extern int rb_w32_has_cancel_io(void); extern int rb_w32_is_socket(int); extern int WSAAPI rb_w32_accept(int, struct sockaddr *, int *); extern int WSAAPI rb_w32_bind(int, const struct sockaddr *, int); Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 27731) +++ ruby_1_9_2/ChangeLog (revision 27732) @@ -1,3 +1,10 @@ +Tue May 11 14:09:21 2010 NAKAMURA Usaku <usa@r...> + + * win32/win32.c, include/ruby/win32.h (rb_w32_has_cancel_io): new + function. + + * io.c (WAIT_FD_IN_WIN32): check only when it's not cancelable. + Tue May 11 11:49:44 2010 Nobuyoshi Nakada <nobu@r...> * ext/sdbm/sdbm.h (DBM): large file support on win32. Index: ruby_1_9_2/io.c =================================================================== --- ruby_1_9_2/io.c (revision 27731) +++ ruby_1_9_2/io.c (revision 27732) @@ -189,9 +189,10 @@ #define READ_CHAR_PENDING(fptr) ((fptr)->cbuf_len) #if defined(_WIN32) -#define WAIT_FD_IN_WIN32(fptr) rb_thread_wait_fd((fptr)->fd); +#define WAIT_FD_IN_WIN32(fptr) \ + (rb_w32_has_cancel_io() ? 0 : rb_thread_wait_fd((fptr)->fd)) #else -#define WAIT_FD_IN_WIN32(fptr) ; +#define WAIT_FD_IN_WIN32(fptr) #endif #define READ_CHECK(fptr) do {\ Index: ruby_1_9_2/win32/win32.c =================================================================== --- ruby_1_9_2/win32/win32.c (revision 27731) +++ ruby_1_9_2/win32/win32.c (revision 27732) @@ -548,6 +548,12 @@ typedef BOOL (WINAPI *cancel_io_t)(HANDLE); static cancel_io_t cancel_io = NULL; +int +rb_w32_has_cancel_io(void) +{ + return cancel_io != NULL; +} + static void init_func(void) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/