6 use Config qw/%Config/;
9 if (!$Config{useithreads}) {
12 plan(skip_all => 'This perl wasn\'t built to support threads');
18 use Test::More tests => 10 * 2 * 2 * (1 + 2);
20 defined and diag "Using threads $_" for $threads::VERSION;
23 package Lexical::Types::Test::Tag;
26 my $tid = threads->tid();
27 my ($file, $line) = (caller(0))[1, 2];
28 my $where = "at $file line $line in thread $tid";
29 Test::More::is($_[0], __PACKAGE__, "base type is correct $where");
30 Test::More::is($_[2], 'Tag', "original type is correct $where");
38 use Lexical::Types as => 'Lexical::Types::Test::';
41 my $tid = threads->tid();
45 is $t, $tid, "typed lexical correctly initialized at run $_ in thread $tid";
48 use Lexical::Types as => "Lexical::Types::Test::";
50 is $t2, $tid, "typed lexical correctly initialized in eval at run $_ in thread $tid";
56 my @t = map threads->create(\&try), 1 .. 10;