diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-04 20:38:48 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-04 20:38:48 +0000 |
commit | 291a82f748de56e65fac10edefc51ec7a54a82d4 (patch) | |
tree | 0f2015b8639433f565f09b0b520b40d6014bf0b1 /thread.c | |
parent | 3dbd8d1f66537f968f0461ed8547460b3b1241b3 (diff) |
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
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; |