From: Dave Mitchell Date: Thu, 12 May 2005 19:07:27 +0000 (+0000) Subject: make join.t threadsafe! X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d94cde48b58209946d142fc5018969fd2b8285e8;p=p5sagit%2Fp5-mst-13.2.git make join.t threadsafe! tests 13 and 14 could output in reverse order. Add a lock to stop this. p4raw-id: //depot/perl@24455 --- diff --git a/ext/threads/t/join.t b/ext/threads/t/join.t index 472d1d2..dbd6448 100644 --- a/ext/threads/t/join.t +++ b/ext/threads/t/join.t @@ -25,6 +25,8 @@ use Devel::Peek qw(Dump); sub ok { my ($ok, $name) = @_; + lock $test_id; # make print and increment atomic + # You have to do it this way or VMS will get confused. print $ok ? "ok $test_id - $name\n" : "not ok $test_id - $name\n"; @@ -149,6 +151,7 @@ if ($^O eq 'linux') { # purpose is to incite a lot of calls to newCONSTSUB. See the p5p # archives for the thread "maint@20974 or before broke mp2 ithreads test". use IO::File; + # this coredumped between #20930 and #21000 $_->join for map threads->new(sub{ok($_, "stress newCONSTSUB")}), 1..2; }