From: Jerry D. Hedden Date: Wed, 10 Oct 2007 12:39:23 +0000 (-0400) Subject: Move threads test added in change 32091 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f0d3b40c7e5cc0486a1c24aa761d8b25053600dc;p=p5sagit%2Fp5-mst-13.2.git Move threads test added in change 32091 From: "Jerry D. Hedden" Message-ID: <1ff86f510710100939v29aef6beqcb782934e641ea79@mail.gmail.com> p4raw-id: //depot/perl@32098 --- diff --git a/ext/threads/t/problems.t b/ext/threads/t/problems.t index 2cbab00..d979b3a 100644 --- a/ext/threads/t/problems.t +++ b/ext/threads/t/problems.t @@ -29,9 +29,9 @@ BEGIN { $| = 1; if ($] == 5.008) { - print("1..12\n"); ### Number of tests that will be run ### + print("1..11\n"); ### Number of tests that will be run ### } else { - print("1..16\n"); ### Number of tests that will be run ### + print("1..15\n"); ### Number of tests that will be run ### } }; @@ -178,20 +178,4 @@ is(keys(%h), 1, "keys correct in parent with restricted hash"); $child = threads->create(sub { return (scalar(keys(%h))); })->join; is($child, 1, "keys correct in child with restricted hash"); - -# [perl #45053] Memory corruption with heavy module loading in threads -# -# run-time usage of newCONSTSUB (as done by the IO boot code) wasn't -# thread-safe - got occasional coredumps or malloc corruption - -{ - my @t; - push @t, threads->create( sub { require IO }) for 1..100; - $_->join for @t; - print("ok $test - [perl #45053]\n"); - $test++; -} - - - # EOF diff --git a/t/op/threads.t b/t/op/threads.t index e52a115..8dadfb3 100644 --- a/t/op/threads.t +++ b/t/op/threads.t @@ -16,7 +16,7 @@ BEGIN { exit 0; } - plan(9); + plan(10); } use strict; @@ -143,4 +143,15 @@ EOI } # TODO +# [perl #45053] Memory corruption with heavy module loading in threads +# +# run-time usage of newCONSTSUB (as done by the IO boot code) wasn't +# thread-safe - got occasional coredumps or malloc corruption +{ + my @t; + push @t, threads->create( sub { require IO }) for 1..100; + $_->join for @t; + ok(1, '[perl #45053]'); +} + # EOF