ok(15, 0 == threads->tid(),"Check so that tid for threads work for main thread");
{
+ no warnings;
local *CLONE = sub { ok(16, threads->tid() == 9, "Tid should be correct in the clone")};
threads->create(sub { ok(17, threads->tid() == 9, "And tid be 9 here too") })->join();
}
$test_id++;
return $ok;
}
-ok(1);
+ok(1,'');
END { ok(1,"End block run once") }
threads->create(sub { eval "END { ok(1,'') }"})->join();
threads->create(sub { eval "END { ok(1,'') }"})->join();
{
my ($thread) = threads->create(sub { return (1,2,3) });
my @retval = $thread->join();
- ok($retval[0] == 1 && $retval[1] == 2 && $retval[2] == 3);
+ ok($retval[0] == 1 && $retval[1] == 2 && $retval[2] == 3,'');
}
{
my $retval = threads->create(sub { return [1] })->join();
- ok($retval->[0] == 1,"Check that a array ref works");
+ ok($retval->[0] == 1,"Check that a array ref works",);
}
{
my $retval = threads->create(sub { return { foo => "bar" }})->join();
{
my $test = "hi";
my $retval = threads->create(sub { return $_[0]}, \$test)->join();
- ok($$retval eq 'hi');
+ ok($$retval eq 'hi','');
}
{
my $test = "hi";
share($test);
my $retval = threads->create(sub { return $_[0]}, \$test)->join();
- ok($$retval eq 'hi');
+ ok($$retval eq 'hi','');
$test = "foo";
- ok($$retval eq 'foo');
+ ok($$retval eq 'foo','');
}
{
my %foo;
return $ok;
}
-ok(2, scalar @{[threads->list]} == 0);
+ok(2, scalar @{[threads->list]} == 0,'');
threads->create(sub {})->join();
-ok(3, scalar @{[threads->list]} == 0);
+ok(3, scalar @{[threads->list]} == 0,'');
my $thread = threads->create(sub {});
-ok(4, scalar @{[threads->list]} == 1);
+ok(4, scalar @{[threads->list]} == 1,'');
$thread->join();
-ok(5, scalar @{[threads->list]} == 0);
+ok(5, scalar @{[threads->list]} == 0,'');
-$thread = threads->create(sub { ok(6, threads->self == (threads->list)[0])});
+$thread = threads->create(sub { ok(6, threads->self == (threads->list)[0],'')});
threads->yield; # help out non-preemptive thread implementations
sleep 1;
-ok(7, $thread == (threads->list)[0]);
+ok(7, $thread == (threads->list)[0],'');
$thread->join();
-ok(8, scalar @{[threads->list]} == 0);
+ok(8, scalar @{[threads->list]} == 0,'');