thr5005.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
BEGIN {
chdir 't' if -d 't';
print "1..0 # Skip: not use5005threads\n";
exit 0;
}
# XXX known trouble with global destruction
$ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3;
}
$| = 1;
print "1..22\n";
use Thread 'yield';
print "ok 1\n";
sub content
{
print shift;
return shift;
}
# create a thread passing args and immedaietly wait for it.
print $t->join;
# check that lock works ...
print "ok 4\n";
}
$t->join;
sub dorecurse
{
my $val = shift;
my $ret;
print $val;
if (@_)
{
}
}
$t->join;
# test that sleep lets other thread run
sleep 6;
print "ok 12\n";
$t->join;
my $val = shift;
my $ret;
print $val;
if (@_)
{
}
$ret;
}
{
my($s, $m) = @_;
print "ok $m\n";
}
}
sub testsprintf {
my $testno = shift;
# this may coredump if thread vars are not properly initialised
} else {
}
}
sub threaded {
# Do the match, saving the output in appropriate variables
# Yield control, allowing the other thread to fill in the match variables
# Examine the match variable contents; on broken perls this fails
}
else {
warn <<EOT;
#
# This is a KNOWN FAILURE, and one of the reasons why threading
# is still an experimental feature. It is here to stop people
# from deploying threads in production. ;-)
#
EOT
}
}
print "ok 22\n";