5 unshift @INC, '../lib';
6 require Config; import Config;
7 if (! $Config{'usethreads'}) {
8 print "1..0 # Skip: this perl is not threaded\n";
12 # XXX known trouble with global destruction
13 $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3;
26 # create a thread passing args and immedaietly wait for it.
27 my $t = new Thread \&content,("ok 2\n","ok 3\n", 1..1000);
30 # check that lock works ...
32 $t = new Thread sub { lock $foo; print "ok 5\n" };
44 $ret = Thread->new(\&dorecurse, @_);
49 $t = new Thread \&dorecurse, map { "ok $_\n" } 6..10;
52 # test that sleep lets other thread run
53 $t = new Thread \&dorecurse,"ok 11\n";
66 $ret = Thread->new(\&islocked, shift);
71 $t = Thread->new(\&islocked, "ok 13\n", "ok 14\n");
76 sub new { bless [], shift }
78 use attrs qw(locked method);
82 sub gollum { &monster }
84 Loch::Ness->monster(15);
85 Loch::Ness->new->monster(16);
86 Loch::Ness->gollum(17);
87 Loch::Ness->new->gollum(18);