summaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-08 23:49:22 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-08 23:49:22 +0000
commitc690043ec05c2d94c01aca97bba3eadfdb1d8419 (patch)
treea3d8dd0a3d44c32322dfcbc2633ff66349cef55f /thread.c
parente016a87e3e0c226d0382a321b4971e28595e8fc2 (diff)
downloadruby-c690043ec05c2d94c01aca97bba3eadfdb1d8419.tar.gz
ruby-c690043ec05c2d94c01aca97bba3eadfdb1d8419.tar.xz
ruby-c690043ec05c2d94c01aca97bba3eadfdb1d8419.zip
* thread.c (rb_thread_wait_fd_rw): should not block by select if
there's only one thread living. fixed [ruby-dev:36646]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 646223e8f..cf667e19d 100644
--- a/thread.c
+++ b/thread.c
@@ -2235,6 +2235,7 @@ rb_thread_wait_fd_rw(int fd, int read)
if (fd < 0) {
rb_raise(rb_eIOError, "closed stream");
}
+ if (rb_thread_alone()) return;
while (result <= 0) {
rb_fdset_t set;
rb_fd_init(&set);