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()
[perl5.git] / t / op / threads.t
index cf11ead..4b731f0 100644 (file)
@@ -16,7 +16,7 @@ BEGIN {
        exit 0;
      }
 
-     plan(23);
+     plan(24);
 }
 
 use strict;
@@ -166,7 +166,7 @@ curr_test(curr_test() + 2);
 
 
 # the seen_evals field of a regexp was getting zeroed on clone, so
-# within a thread it didn't  know that a regex object contrained a 'safe'
+# within a thread it didn't  know that a regex object contained a 'safe'
 # re_eval expression, so it later died with 'Eval-group not allowed' when
 # you tried to interpolate the object
 
@@ -349,4 +349,14 @@ threads->create(
 
 EOI
 
+# [perl #78494] Pipes shared between threads block when closed
+watchdog 10;
+{
+  my $perl = which_perl;
+  $perl = qq'"$perl"' if $perl =~ /\s/;
+  open(my $OUT, "|$perl") || die("ERROR: $!");
+  threads->create(sub { })->join;
+  ok(1, "Pipes shared between threads do not block when closed");
+}
+
 # EOF