X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FScope-Upper.git;a=blobdiff_plain;f=t%2F79-uid-threads.t;h=817a144973440f8102f5161a2b7ef93d626ef28f;hp=81321c1193a46ca476bdf359d6f261fcd614ec16;hb=ba6783aa6d08cd998143a4b4cb0d7516597dfc51;hpb=d3f4330e8978050c587078a1f6a6f1c19e7a6318 diff --git a/t/79-uid-threads.t b/t/79-uid-threads.t index 81321c1..817a144 100644 --- a/t/79-uid-threads.t +++ b/t/79-uid-threads.t @@ -37,14 +37,16 @@ sub cb { my %uids; my $threads = 0; -for my $thread (map threads->create(\&cb), 1 .. 30) { - ++$threads; +for my $thread (map spawn(\&cb), 1 .. 30) { my $tid = $thread->tid; my $uid = $thread->join; - ++$uids{$uid}; - ok !validate_uid($uid), "\$here is no longer valid (out of thread $tid)"; + if (defined $uid) { + ++$threads; + ++$uids{$uid}; + ok !validate_uid($uid), "\$here is no longer valid (out of thread $tid)"; + } } is scalar(keys %uids), $threads, 'all the UIDs were different'; -done_testing($threads * 5 + 1); +done_testing;