ruby-changes:20414
From: nobu <ko1@a...>
Date: Sat, 9 Jul 2011 08:37:19 +0900 (JST)
Subject: [ruby-changes:20414] nobu:r32462 (trunk): * io.c (rb_io_close): close(2) on a fd which is being read by
nobu 2011-07-09 08:37:08 +0900 (Sat, 09 Jul 2011) New Revision: 32462 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32462 Log: * 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 Modified files: trunk/ChangeLog trunk/io.c Index: ChangeLog =================================================================== --- ChangeLog (revision 32461) +++ ChangeLog (revision 32462) @@ -1,3 +1,8 @@ +Sat Jul 9 08:37:05 2011 Nobuyoshi Nakada <nobu@r...> + + * 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 + Fri Jul 8 21:20:39 2011 NARUSE, Yui <naruse@r...> * addr2line.c: use USE_ELF instead of __ELF__ because Solaris Index: io.c =================================================================== --- io.c (revision 32461) +++ io.c (revision 32462) @@ -3621,6 +3621,12 @@ 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/