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:
parent
3dbd8d1f66
commit
291a82f748
1 changed files with 3 additions and 0 deletions
3
thread.c
3
thread.c
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue