2 # test that END blocks are run in the thread that created them and
3 # not in any child threads
8 require Config; import Config;
9 unless ($Config{'useithreads'}) {
10 print "1..0 # Skip: no useithreads\n";
13 if ($Config{'extensions'} !~ /\bDevel\/Peek\b/) {
14 print "1..0 # Skip: Devel::Peek was not built\n";
19 use ExtUtils::testlib;
21 BEGIN { print "1..6\n" };
27 use Devel::Peek qw(Dump);
32 # You have to do it this way or VMS will get confused.
33 print $ok ? "ok $test_id - $name\n" : "not ok $test_id - $name\n";
35 printf "# Failed test at line %d\n", (caller)[2] unless $ok;
40 END { ok(1,"End block run once") }
41 threads->create(sub { eval "END { ok(1,'') }"})->join();
42 threads->create(sub { eval "END { ok(1,'') }"})->join();
43 threads->create(\&thread)->join();
46 eval "END { ok(1,'') }";
47 threads->create(sub { eval "END { ok(1,'') }"})->join();