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

ruby-changes:21297

From: kosaki <ko1@a...>
Date: Tue, 27 Sep 2011 09:59:14 +0900 (JST)
Subject: [ruby-changes:21297] kosaki:r33346 (trunk): * thread_pthread.c: make native_fd_select().

kosaki	2011-09-27 09:59:04 +0900 (Tue, 27 Sep 2011)

  New Revision: 33346

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

  Log:
    * thread_pthread.c: make native_fd_select().
    * thread.c (do_select): remove #ifdef _WIN32. Instead, use
      native_fd_select() always.

  Modified files:
    trunk/ChangeLog
    trunk/thread.c
    trunk/thread_pthread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33345)
+++ ChangeLog	(revision 33346)
@@ -1,3 +1,9 @@
+Tue Sep 27 09:55:40 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* thread_pthread.c: make native_fd_select().
+	* thread.c (do_select): remove #ifdef _WIN32. Instead, use
+	  native_fd_select() always.
+
 Tue Sep 27 09:44:59 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* thread.c (do_select): remove cygwin specific hack. It's layer
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 33345)
+++ thread_pthread.c	(revision 33346)
@@ -856,6 +856,12 @@
 
 #endif /* USE_NATIVE_THREAD_PRIORITY */
 
+static int
+native_fd_select(int n, rb_fdset_t *readfds, rb_fdset_t *writefds, rb_fdset_t *exceptfds, struct timeval *timeout, rb_thread_t *th)
+{
+    return rb_fd_select(n, readfds, writefds, exceptfds, timeout);
+}
+
 static void
 ubf_pthread_cond_signal(void *ptr)
 {
Index: thread.c
===================================================================
--- thread.c	(revision 33345)
+++ thread.c	(revision 33346)
@@ -2529,6 +2529,7 @@
     rb_fdset_t UNINITIALIZED_VAR(orig_except);
     double limit = 0;
     struct timeval wait_rest;
+    rb_thread_t *th = GET_THREAD();
 
     if (timeout) {
 	limit = timeofday();
@@ -2547,21 +2548,10 @@
   retry:
     lerrno = 0;
 
-#if defined(_WIN32)
-    {
-	rb_thread_t *th = GET_THREAD();
-	BLOCKING_REGION({
+    BLOCKING_REGION({
 	    result = native_fd_select(n, read, write, except, timeout, th);
 	    if (result < 0) lerrno = errno;
 	}, ubf_select, th);
-    }
-#else
-    BLOCKING_REGION({
-	result = rb_fd_select(n, read, write, except, timeout);
-	if (result < 0) lerrno = errno;
-    }, ubf_select, GET_THREAD());
-#endif
-
     errno = lerrno;
 
     if (result < 0) {

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

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