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
5
io.c
5
io.c
@ -3410,8 +3410,13 @@ io_read_memory_call(VALUE arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
return rb_thread_io_blocking_call(internal_read_func, iis, iis->fptr->fd, RB_WAITFD_IN);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static long
|
static long
|
||||||
io_read_memory_locktmp(VALUE str, struct io_internal_read_struct *iis)
|
io_read_memory_locktmp(VALUE str, struct io_internal_read_struct *iis)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user