Adjust styles [ci skip]
This commit is contained in:
parent
ae5dffd666
commit
a706c09fa6
13
io.c
13
io.c
@ -1311,8 +1311,8 @@ io_from_fd(int fd)
|
|||||||
return prep_io(fd, FMODE_PREP, rb_cIO, NULL);
|
return prep_io(fd, FMODE_PREP, rb_cIO, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static int
|
||||||
int io_wait_for_single_fd(int fd, int events, struct timeval *timeout)
|
io_wait_for_single_fd(int fd, int events, struct timeval *timeout)
|
||||||
{
|
{
|
||||||
VALUE scheduler = rb_fiber_scheduler_current();
|
VALUE scheduler = rb_fiber_scheduler_current();
|
||||||
|
|
||||||
@ -1420,7 +1420,8 @@ rb_thread_fd_writable(int fd)
|
|||||||
return rb_wait_for_single_fd(fd, RUBY_IO_WRITABLE, NULL);
|
return rb_wait_for_single_fd(fd, RUBY_IO_WRITABLE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE rb_io_maybe_wait(int error, VALUE io, VALUE events, VALUE timeout)
|
VALUE
|
||||||
|
rb_io_maybe_wait(int error, VALUE io, VALUE events, VALUE timeout)
|
||||||
{
|
{
|
||||||
// fptr->fd can be set to -1 at any time by another thread when the GVL is
|
// fptr->fd can be set to -1 at any time by another thread when the GVL is
|
||||||
// released. Many code, e.g. `io_bufread` didn't check this correctly and
|
// released. Many code, e.g. `io_bufread` didn't check this correctly and
|
||||||
@ -1460,12 +1461,14 @@ VALUE rb_io_maybe_wait(int error, VALUE io, VALUE events, VALUE timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int rb_io_maybe_wait_readable(int error, VALUE io, VALUE timeout)
|
int
|
||||||
|
rb_io_maybe_wait_readable(int error, VALUE io, VALUE timeout)
|
||||||
{
|
{
|
||||||
return RB_NUM2INT(rb_io_maybe_wait(error, io, RB_INT2NUM(RUBY_IO_READABLE), timeout));
|
return RB_NUM2INT(rb_io_maybe_wait(error, io, RB_INT2NUM(RUBY_IO_READABLE), timeout));
|
||||||
}
|
}
|
||||||
|
|
||||||
int rb_io_maybe_wait_writable(int error, VALUE io, VALUE timeout)
|
int
|
||||||
|
rb_io_maybe_wait_writable(int error, VALUE io, VALUE timeout)
|
||||||
{
|
{
|
||||||
return RB_NUM2INT(rb_io_maybe_wait(error, io, RB_INT2NUM(RUBY_IO_WRITABLE), timeout));
|
return RB_NUM2INT(rb_io_maybe_wait(error, io, RB_INT2NUM(RUBY_IO_WRITABLE), timeout));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user