[前][次][番号順一覧][スレッド一覧]

ruby-changes:13238

From: usa <ko1@a...>
Date: Fri, 18 Sep 2009 14:45:21 +0900 (JST)
Subject: [ruby-changes:13238] Ruby:r24996 (ruby_1_8): * win32/win32.c (rb_w32_select): wait specified time on select.

usa	2009-09-18 14:44:49 +0900 (Fri, 18 Sep 2009)

  New Revision: 24996

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24996

  Log:
    * win32/win32.c (rb_w32_select): wait specified time on select.

  Modified files:
    branches/ruby_1_8/win32/win32.c

Index: ruby_1_8/win32/win32.c
===================================================================
--- ruby_1_8/win32/win32.c	(revision 24995)
+++ ruby_1_8/win32/win32.c	(revision 24996)
@@ -2339,11 +2339,12 @@
 		break;
 	    }
 	    else {
-		struct timeval *dowait = &wait;
-
 		fd_set orig_rd;
 		fd_set orig_wr;
 		fd_set orig_ex;
+		struct timeval *dowait = &wait;
+		if (timeout && compare(&rest, &wait) < 0) dowait = &rest;
+
 		if (rd) orig_rd = *rd;
 		if (wr) orig_wr = *wr;
 		if (ex) orig_ex = *ex;
@@ -2358,7 +2359,6 @@
 		    gettimeofday(&now, NULL);
 		    rest = limit;
 		    if (!subtract(&rest, &now)) break;
-		    if (compare(&rest, &wait) < 0) dowait = &rest;
 		}
 	    }
 	}

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]