6 require Config; import Config;
7 if (! $Config{'usethreads'}) {
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");
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");