X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F40-threads.t;fp=t%2F40-threads.t;h=d10146d603254114379ae09e924d1f240aa7c507;hb=8edd65482a48cda016b4677014dcb80b2b923cb1;hp=bd64663e44166c2a581455384ffb8b438bc27fcf;hpb=6db3edecb6ba3be691816c4c16f623227159a832;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/t/40-threads.t b/t/40-threads.t index bd64663..d10146d 100644 --- a/t/40-threads.t +++ b/t/40-threads.t @@ -28,7 +28,7 @@ use Variable::Magic qw/wizard cast dispell getdata VMG_THREADSAFE VMG_OP_INFO_NA BEGIN { skipall 'This Variable::Magic isn\'t thread safe' unless VMG_THREADSAFE; - plan tests => 2 * (4 * 18 + 1) + 2 * (4 * 13 + 1); + plan tests => (4 * 18 + 1) + (4 * 13 + 1); my $v = $threads::VERSION; diag "Using threads $v" if defined $v; $v = $threads::shared::VERSION; @@ -38,12 +38,11 @@ BEGIN { my $destroyed : shared = 0; sub try { - my ($dispell, $sig, $op_info) = @_; + my ($dispell, $op_info) = @_; my $tid = threads->tid(); my $c = 0; my $wiz = eval { wizard data => sub { $_[1] + $tid }, - sig => $sig, get => sub { ++$c; 0 }, set => sub { my $op = $_[-1]; @@ -91,19 +90,17 @@ sub try { } for my $dispell (1, 0) { - for my $sig (undef, Variable::Magic::gensig()) { - { - lock $destroyed; - $destroyed = 0; - } + { + lock $destroyed; + $destroyed = 0; + } - my @t = map { threads->create(\&try, $dispell, $sig, $_) } - (VMG_OP_INFO_NAME) x 2, (VMG_OP_INFO_OBJECT) x 2; - $_->join for @t; + my @t = map { threads->create(\&try, $dispell, $_) } + (VMG_OP_INFO_NAME) x 2, (VMG_OP_INFO_OBJECT) x 2; + $_->join for @t; - { - lock $destroyed; - is $destroyed, (1 - $dispell) * 4, 'destructors'; - } + { + lock $destroyed; + is $destroyed, (1 - $dispell) * 4, 'destructors'; } }