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

ruby-changes:20532

From: akr <ko1@a...>
Date: Tue, 19 Jul 2011 16:12:30 +0900 (JST)
Subject: [ruby-changes:20532] akr:r32579 (trunk): * io.c (rb_update_max_fd): new function.

akr	2011-07-19 16:10:19 +0900 (Tue, 19 Jul 2011)

  New Revision: 32579

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

  Log:
    * io.c (rb_update_max_fd): new function.
    
    * internal.h (rb_update_max_fd): declare rb_update_max_fd.
    
    * thread_pthread.c (rb_thread_create_timer_thread): update max fd when
      timer thread pipe is created.

  Modified files:
    trunk/ChangeLog
    trunk/internal.h
    trunk/io.c
    trunk/thread_pthread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32578)
+++ ChangeLog	(revision 32579)
@@ -1,3 +1,12 @@
+Tue Jul 19 16:07:45 2011  Tanaka Akira  <akr@f...>
+
+	* io.c (rb_update_max_fd): new function.
+
+	* internal.h (rb_update_max_fd): declare rb_update_max_fd.
+
+	* thread_pthread.c (rb_thread_create_timer_thread): update max fd when
+	  timer thread pipe is created.
+
 Mon Jul 18 13:36:47 2011  Aaron Patterson <aaron@t...>
 
 	* ext/psych/lib/psych.rb: define a new BadAlias error class.
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 32578)
+++ thread_pthread.c	(revision 32579)
@@ -1191,6 +1191,8 @@
 	    if (err != 0) {
 		rb_bug_errno("thread_timer: Failed to create communication pipe for timer thread", errno);
 	    }
+            rb_update_max_fd(timer_thread_pipe[0]);
+            rb_update_max_fd(timer_thread_pipe[1]);
 #if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(F_SETFL)
 	    {
 		int oflags;
Index: io.c
===================================================================
--- io.c	(revision 32578)
+++ io.c	(revision 32579)
@@ -155,6 +155,11 @@
     do { \
         if (max_file_descriptor < (fd)) max_file_descriptor = (fd); \
     } while (0)
+void
+rb_update_max_fd(int fd)
+{
+    UPDATE_MAXFD(fd);
+}
 
 #define argf_of(obj) (*(struct argf *)DATA_PTR(obj))
 #define ARGF argf_of(argf)
Index: internal.h
===================================================================
--- internal.h	(revision 32578)
+++ internal.h	(revision 32579)
@@ -101,6 +101,7 @@
 void ruby_set_inplace_mode(const char *);
 ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
 void rb_stdio_set_default_encoding(void);
+void rb_update_max_fd(int fd);
 
 /* iseq.c */
 VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);

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

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