diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | internal.h | 1 | ||||
-rw-r--r-- | io.c | 5 | ||||
-rw-r--r-- | thread_pthread.c | 2 |
4 files changed, 17 insertions, 0 deletions
@@ -1,3 +1,12 @@ +Tue Jul 19 16:07:45 2011 Tanaka Akira <akr@fsij.org> + + * 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@tenderlovemaking.com> * ext/psych/lib/psych.rb: define a new BadAlias error class. diff --git a/internal.h b/internal.h index 172e7f45ad..77f61da89d 100644 --- a/internal.h +++ b/internal.h @@ -101,6 +101,7 @@ const char *ruby_get_inplace_mode(void); 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); @@ -155,6 +155,11 @@ static int max_file_descriptor = NOFILE; 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) diff --git a/thread_pthread.c b/thread_pthread.c index 13a8b359e1..8ef34dd15f 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1191,6 +1191,8 @@ rb_thread_create_timer_thread(void) 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; |