MN: skip waiting on `read_nonblock'
if the IO for `IO#read_nonblock` is not ready, it needs to return (or raise) immediately.
This commit is contained in:
parent
2fe9e08578
commit
beec3d07c9
7
io.c
7
io.c
@ -3410,7 +3410,12 @@ io_read_memory_call(VALUE arg)
|
||||
}
|
||||
}
|
||||
|
||||
return rb_thread_io_blocking_call(internal_read_func, iis, iis->fptr->fd, RB_WAITFD_IN);
|
||||
if (iis->nonblock) {
|
||||
return rb_thread_io_blocking_call(internal_read_func, iis, iis->fptr->fd, 0);
|
||||
}
|
||||
else {
|
||||
return rb_thread_io_blocking_call(internal_read_func, iis, iis->fptr->fd, RB_WAITFD_IN);
|
||||
}
|
||||
}
|
||||
|
||||
static long
|
||||
|
Loading…
x
Reference in New Issue
Block a user