Change 18420 by jhi@lyta on 2003/01/04 00:04:33
Mea culpa: the join() was the string join, not the
ithreads join().
Affected files ...
... //depot/maint-5.8/perl/ext/threads/t/join.t#6 edit
Differences ...
==== //depot/maint-5.8/perl/ext/threads/t/join.t#6 (text) ====
Index: perl/ext/threads/t/join.t
--- perl/ext/threads/t/join.t#5~18241~ Tue Dec 3 06:02:58 2002
+++ perl/ext/threads/t/join.t Fri Jan 3 16:04:33 2003
@@ -93,17 +93,19 @@
if ($^O eq 'linux') { # We parse ps output so this is OS-dependent.
# First modify $0 in a subthread.
- print "# 1a: \$0 = $0\n";
- join( threads->new( sub {
- print "# 2a: \$0 = $0\n";
- $0 = "foobar";
- print "# 2b: \$0 = $0\n" } ) );
- print "# 1b: \$0 = $0\n";
- if (open PS, "ps -f |") {
+ print "# mainthread: \$0 = $0\n";
+ threads->new( sub {
+ print "# subthread: \$0 = $0\n";
+ $0 = "foobar";
+ print "# subthread: \$0 = $0\n" } )->join;
+ print "# mainthread: \$0 = $0\n";
+ print "# pid = $$\n";
+ if (open PS, "ps -f |") { # Note: must work in (all) Linux(es).
my $ok;
while (<PS>) {
- print "# $_";
- if (/^\S+\s+$$\s.+\sfoobar\s*$/) {
+ s/\s+$//; # there seems to be extra whitespace at the end by ps(1)?
+ print "# $_\n";
+ if (/^\S+\s+$$\s.+\sfoobar$/) {
$ok++;
last;
}
End of Patch.