Bug #17527 ยป rb_io_wait_methods_with_scheduler_skip_errno_checks.patch
io.c | ||
---|---|---|
int
|
||
rb_io_wait_readable(int f)
|
||
{
|
||
VALUE scheduler = rb_scheduler_current();
|
||
if (scheduler != Qnil) {
|
||
return RTEST(
|
||
rb_scheduler_io_wait_readable(scheduler, rb_io_from_fd(f))
|
||
);
|
||
}
|
||
VALUE scheduler;
|
||
io_fd_check_closed(f);
|
||
switch (errno) {
|
||
... | ... | |
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
|
||
case EWOULDBLOCK:
|
||
#endif
|
||
rb_thread_wait_fd(f);
|
||
scheduler = rb_scheduler_current();
|
||
if (scheduler != Qnil) {
|
||
return RTEST(
|
||
rb_scheduler_io_wait_readable(scheduler, rb_io_from_fd(f))
|
||
);
|
||
} else {
|
||
rb_thread_wait_fd(f);
|
||
}
|
||
return TRUE;
|
||
default:
|
||
... | ... | |
int
|
||
rb_io_wait_writable(int f)
|
||
{
|
||
VALUE scheduler = rb_scheduler_current();
|
||
if (scheduler != Qnil) {
|
||
return RTEST(
|
||
rb_scheduler_io_wait_writable(scheduler, rb_io_from_fd(f))
|
||
);
|
||
}
|
||
VALUE scheduler;
|
||
io_fd_check_closed(f);
|
||
switch (errno) {
|
||
... | ... | |
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
|
||
case EWOULDBLOCK:
|
||
#endif
|
||
rb_thread_fd_writable(f);
|
||
scheduler = rb_scheduler_current();
|
||
if (scheduler != Qnil) {
|
||
return RTEST(
|
||
rb_scheduler_io_wait_writable(scheduler, rb_io_from_fd(f))
|
||
);
|
||
} else {
|
||
rb_thread_fd_writable(f);
|
||
}
|
||
return TRUE;
|
||
default:
|