summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-04 20:38:48 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-04 20:38:48 +0000
commit291a82f748de56e65fac10edefc51ec7a54a82d4 (patch)
tree0f2015b8639433f565f09b0b520b40d6014bf0b1 /thread.c
parent3dbd8d1f66537f968f0461ed8547460b3b1241b3 (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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 161f16365c..9c7fcee05f 100644
--- a/thread.c
+++ b/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;