This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #78494] Pipes cause threads to hang on join()
authorFather Chrysostomos <sprout@cpan.org>
Wed, 16 Feb 2011 00:33:24 +0000 (16:33 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 16 Feb 2011 00:34:22 +0000 (16:34 -0800)
commit2e0cfa16dea85dd33fe3cbf38f3324f4a8418181
tree5189c0767046a1d431bd10c87d9b34efbed4ea04
parentc222ef4643569ab52b77652219561edee7a72409
[perl #78494] Pipes cause threads to hang on join()

or on close() in either thread.

close() in one thread blocks until close() is called in the other
thread, because both closes are waiting for the child process to end.

Since we have a reference-counting mechanism for the underlying
fileno, we can use that to determine whether close() should wait.

This does not solve the problem of close $OUT block when it has been
duplicated via open $OUT2, ">&" and $OUT2 is still in scope.
perlio.c
perliol.h
pod/perldiag.pod
pod/perlfunc.pod
t/op/threads.t
util.c