appropriate spots helps non-preemptive thread
implementations, like the GNU pth. Tested at NetBSD
by Martin Weber <Ephaeton@gmx.net>.
p4raw-id: //depot/perl@16555
my $thread1 = threads->create('test4');
$thread1->detach();
+threads->yield; # help out non-preemptive thread implementations
sleep 2;
ok(7,1,"Detach test");
ok(5, scalar @{[threads->list]} == 1);
$thread = threads->create(sub { ok(6, threads->self == (threads->list)[1])});
+threads->yield; # help out non-preemptive thread implementations
sleep 1;
ok(7, $thread == (threads->list)[1]);
$thread->join();
{
# test that sleep lets other thread run
my $t = threads->new(\&dorecurse, "ok 11\n");
+ threads->yield; # help out non-preemptive thread implementations
sleep 1;
print "ok 12\n";
$t->join();