5 if ($ENV{'PERL_CORE'}){
7 unshift @INC, '../lib';
10 if (! $Config{'useithreads'}) {
11 print("1..0 # Skip: Perl not compiled with 'useithreads'\n");
16 use ExtUtils::testlib;
23 print("1..6\n"); ### Number of tests that will be run ###
37 # You have to do it this way or VMS will get confused.
39 print("ok $id - $name\n");
41 print("not ok $id - $name\n");
42 printf("# Failed test at line %d\n", (caller)[2]);
49 ### Start of Testing ###
51 # Test that END blocks are run in the thread that created them,
52 # and not in any child threads.
55 ok(1, 'Main END block')
58 threads->create(sub { eval "END { ok(1, '1st thread END block') }"})->join();
59 threads->create(sub { eval "END { ok(1, '2nd thread END block') }"})->join();
62 eval "END { ok(1, '4th thread END block') }";
63 threads->create(sub { eval "END { ok(1, '5th thread END block') }"})->join();
65 threads->create(\&thread)->join();