4 # test that END blocks are run in the thread that created them and
5 # not in any child threads
8 if ($ENV{'PERL_CORE'}){
10 unshift @INC, '../lib';
13 unless ($Config{'useithreads'}) {
14 print "1..0 # Skip: no useithreads\n";
19 use ExtUtils::testlib;
21 BEGIN { print "1..6\n" };
33 # You have to do it this way or VMS will get confused.
34 print $ok ? "ok $test_id - $name\n" : "not ok $test_id - $name\n";
36 printf "# Failed test at line %d\n", (caller)[2] unless $ok;
41 END { ok(1,"End block run once") }
42 threads->create(sub { eval "END { ok(1,'') }"})->join();
43 threads->create(sub { eval "END { ok(1,'') }"})->join();
44 threads->create(\&thread)->join();
47 eval "END { ok(1,'') }";
48 threads->create(sub { eval "END { ok(1,'') }"})->join();