Pureperlize
[p5sagit/Devel-GlobalDestruction.git] / t / 02_thread.t
1 use Config;
2 BEGIN {
3   unless ($Config{useithreads}) {
4     print "1..0 # SKIP your perl does not support ithreads\n";
5     exit 0;
6   }
7 }
8
9 BEGIN {
10   unless (eval { require threads }) {
11     print "1..0 # SKIP threads.pm not installed\n";
12     exit 0;
13   }
14 }
15
16 use threads;
17 use warnings;
18 use strict;
19
20 BEGIN {
21     if ($ENV{DEVEL_GLOBALDESTRUCTION_PP_TEST}) {
22         require DynaLoader;
23         no warnings 'redefine';
24         my $orig = \&DynaLoader::bootstrap;
25         *DynaLoader::bootstrap = sub {
26             die 'no XS' if $_[0] eq 'Devel::GlobalDestruction';
27             goto $orig;
28         };
29     }
30 }
31
32 my $t = threads->create(sub { do 't/01_basic.t' });
33 $t->join;
34
35 exit 0;