diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-08 23:37:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-08 23:37:08 +0000 |
commit | dc3697f62f4eb78093be3c95a8f8f265d3f184f5 (patch) | |
tree | c2cdb2a5c6c83164bb366ef021f50cd490c5a45e /io.c | |
parent | e33183acca3d11bbfae6f4551bca890cf7d4280a (diff) | |
download | ruby-dc3697f62f4eb78093be3c95a8f8f265d3f184f5.tar.gz |
* io.c (rb_io_close): close(2) on a fd which is being read by
another thread causes deadlock on Mac OS X 10.5
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -3621,6 +3621,12 @@ rb_io_close(VALUE io) if (fptr->fd < 0) return Qnil; fd = fptr->fd; +#if defined __APPLE__ && defined(__MACH__) && \ + (!defined(MAC_OS_X_VERSION_MIN_ALLOWED) || MAC_OS_X_VERSION_MIN_ALLOWED <= 1050) + /* close(2) on a fd which is being read by another thread causes + * deadlock on Mac OS X 10.5 */ + rb_thread_fd_close(fd); +#endif rb_io_fptr_cleanup(fptr, FALSE); rb_thread_fd_close(fd); |