mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
dc22968239
commit
2c7576a021
4 changed files with 17 additions and 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.
|
||||
|
|
|
@ -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);
|
||||
|
|
5
io.c
5
io.c
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue