1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

thread.c (consume_communication_pipe): do not retry after short read

Saves a syscall and slightly improves vm_thread_condvar1
benchmark slightly (more improvements on the way):

                         r64170        this patch
vm_thread_condvar1        0.917        1.065

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2018-08-04 20:38:48 +00:00
parent 3dbd8d1f66
commit 291a82f748

View file

@ -4273,6 +4273,9 @@ consume_communication_pipe(int fd)
result = read(fd, buff, sizeof(buff));
if (result > 0) {
ret = TRUE;
if (result < (ssize_t)sizeof(buff)) {
return ret;
}
}
else if (result == 0) {
return ret;