Change 28598 by [EMAIL PROTECTED] on 2006/07/18 21:02:39
Subject: [PATCH] [Fwd: Smoke [5.9.4] 28575 FAIL(XF) OSF1 V5.1 (EV6/4
cpu)]
From: "Jerry D. Hedden" <[EMAIL PROTECTED]>
Date: Mon, 17 Jul 2006 05:00:01 -0700
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/ext/threads/t/basic.t#20 edit
... //depot/perl/ext/threads/t/free.t#5 edit
Differences ...
==== //depot/perl/ext/threads/t/basic.t#20 (xtext) ====
Index: perl/ext/threads/t/basic.t
--- perl/ext/threads/t/basic.t#19~28099~ 2006-05-04 05:51:51.000000000
-0700
+++ perl/ext/threads/t/basic.t 2006-07-18 14:02:39.000000000 -0700
@@ -68,11 +68,11 @@
{
my $thread1 = threads->create('test4');
$thread1->detach();
+ while ($thread1->is_running()) {
+ threads->yield();
+ sleep 1;
+ }
}
-
-threads->yield; # help out non-preemptive thread implementations
-sleep 2;
-
ok(7, 1, "Detach test");
==== //depot/perl/ext/threads/t/free.t#5 (text) ====
Index: perl/ext/threads/t/free.t
--- perl/ext/threads/t/free.t#4~28475~ 2006-07-04 02:37:10.000000000 -0700
+++ perl/ext/threads/t/free.t 2006-07-18 14:02:39.000000000 -0700
@@ -62,14 +62,17 @@
# Tests freeing the Perl interperter for each thread
# See http://www.nntp.perl.org/group/perl.perl5.porters/110772 for details
-my $COUNT;
-share($COUNT);
+my ($COUNT, $STARTED) :shared;
sub threading_1 {
my $tid = threads->tid();
ok($tid, "Thread $tid started");
- if ($tid < 5) {
+ {
+ lock($STARTED);
+ $STARTED++;
+ }
+ if ($STARTED < 5) {
sleep(1);
threads->create('threading_1')->detach();
}
@@ -95,12 +98,16 @@
}
{
+ $STARTED = 0;
$COUNT = 0;
threads->create('threading_1')->detach();
{
lock($COUNT);
while ($COUNT < 3) {
cond_wait($COUNT);
+ threads->create(sub {
+ threads->create(sub { })->join();
+ })->join();
}
}
}
@@ -109,6 +116,9 @@
lock($COUNT);
while ($COUNT < 5) {
cond_wait($COUNT);
+ threads->create(sub {
+ threads->create(sub { })->join();
+ })->join();
}
}
threads->yield();
@@ -121,7 +131,11 @@
my $tid = threads->tid();
ok($tid, "Thread $tid started");
- if ($tid < 10) {
+ {
+ lock($STARTED);
+ $STARTED++;
+ }
+ if ($STARTED < 5) {
threads->create('threading_2')->detach();
}
@@ -135,11 +149,15 @@
}
{
+ $STARTED = 0;
$COUNT = 0;
threads->create('threading_2')->detach();
+ threads->create(sub {
+ threads->create(sub { })->join();
+ })->join();
{
lock($COUNT);
- while ($COUNT < 3) {
+ while ($COUNT < 5) {
cond_wait($COUNT);
}
}
End of Patch.