summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJerry D. Hedden <jdhedden@cpan.org>2007-10-11 05:12:21 -0400
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-10-11 13:14:21 +0000
commit76eabe0aca153436b67ab32fc018825da54b3981 (patch)
tree1a6abd320996c7f69755b235ef2b1d6786fb4a08 /t
parentf0d3b40c7e5cc0486a1c24aa761d8b25053600dc (diff)
downloadperl-76eabe0aca153436b67ab32fc018825da54b3981.tar.gz
Gentler theads test
From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510710110612j6ecaa1d5ta1a6f2a4e3e13ed3@mail.gmail.com> p4raw-id: //depot/perl@32099
Diffstat (limited to 't')
-rw-r--r--t/op/threads.t7
1 files changed, 6 insertions, 1 deletions
diff --git a/t/op/threads.t b/t/op/threads.t
index 8dadfb3a6c..8907d80f45 100644
--- a/t/op/threads.t
+++ b/t/op/threads.t
@@ -148,8 +148,13 @@ EOI
# run-time usage of newCONSTSUB (as done by the IO boot code) wasn't
# thread-safe - got occasional coredumps or malloc corruption
{
+ local $SIG{__WARN__} = sub {}; # Ignore any thread creation failure warnings
my @t;
- push @t, threads->create( sub { require IO }) for 1..100;
+ for (1..100) {
+ my $thr = threads->create( sub { require IO });
+ last if !defined($thr); # Probably ran out of memory
+ push(@t, $thr);
+ }
$_->join for @t;
ok(1, '[perl #45053]');
}