File: 02_thread.t

package info (click to toggle)
libdevel-globaldestruction-perl 0.06-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 272 kB
  • sloc: perl: 47; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 672 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use Config;
BEGIN {
  unless ($Config{useithreads}) {
    print "1..0 # SKIP your perl does not support ithreads\n";
    exit 0;
  }
}

BEGIN {
  unless (eval { require threads }) {
    print "1..0 # SKIP threads.pm not installed\n";
    exit 0;
  }
}

use threads;
use warnings;
use strict;

BEGIN {
    if ($ENV{DEVEL_GLOBALDESTRUCTION_PP_TEST}) {
        require DynaLoader;
        no warnings 'redefine';
        my $orig = \&DynaLoader::bootstrap;
        *DynaLoader::bootstrap = sub {
            die 'no XS' if $_[0] eq 'Devel::GlobalDestruction';
            goto $orig;
        };
    }
}

my $t = threads->create(sub { do 't/01_basic.t' });
$t->join;

exit 0;