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

ruby-changes:26397

From: kosaki <ko1@a...>
Date: Tue, 18 Dec 2012 19:07:24 +0900 (JST)
Subject: [ruby-changes:26397] kosaki:r38448 (trunk): * io.c (rb_io_wait_writable): don't use rb_thread_wait_fd()

kosaki	2012-12-18 19:07:15 +0900 (Tue, 18 Dec 2012)

  New Revision: 38448

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

  Log:
    * io.c (rb_io_wait_writable): don't use rb_thread_wait_fd()
      because it is for waiting until io readable.
    
    * io.c (rb_io_wait_writable): always use rb_thread_fd_writable()
      instaed of bare rb_wait_for_single_fd(). we shouldn't ignore
      return value.
    * io.c (rb_io_wait_readable): ditto. always use rb_thread_wait_fd().

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38447)
+++ ChangeLog	(revision 38448)
@@ -1,3 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Dec 18 18:57:58 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+
+	* io.c (rb_io_wait_writable): don't use rb_thread_wait_fd()
+	  because it is for waiting until io readable.
+
+	* io.c (rb_io_wait_writable): always use rb_thread_fd_writable()
+	  instaed of bare rb_wait_for_single_fd(). we shouldn't ignore
+	  return value.
+	* io.c (rb_io_wait_readable): ditto. always use rb_thread_wait_fd().
+
 Tue Dec 18 18:55:33 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* thread.c (rb_thread_wait_fd_rw): fix infinite loop bug.
Index: io.c
===================================================================
--- io.c	(revision 38447)
+++ io.c	(revision 38448)
@@ -1050,14 +1050,11 @@ rb_io_wait_readable(int f) https://github.com/ruby/ruby/blob/trunk/io.c#L1050
 #if defined(ERESTART)
       case ERESTART:
 #endif
-	rb_thread_wait_fd(f);
-	return TRUE;
-
       case EAGAIN:
 #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
       case EWOULDBLOCK:
 #endif
-	rb_wait_for_single_fd(f, RB_WAITFD_IN, NULL);
+	rb_thread_wait_fd(f);
 	return TRUE;
 
       default:
@@ -1076,14 +1073,11 @@ rb_io_wait_writable(int f) https://github.com/ruby/ruby/blob/trunk/io.c#L1073
 #if defined(ERESTART)
       case ERESTART:
 #endif
-	rb_thread_wait_fd(f);
-	return TRUE;
-
       case EAGAIN:
 #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
       case EWOULDBLOCK:
 #endif
-	rb_wait_for_single_fd(f, RB_WAITFD_OUT, NULL);
+	rb_thread_fd_writable(f);
 	return TRUE;
 
       default:

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

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