From: Rafael Garcia-Suarez Date: Sat, 4 Jan 2003 16:31:31 +0000 (+0000) Subject: Integrate change #18420 from maint-5.8: X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c8c7fdd1a93cac2b3a20ec43fed0b1327c000811;p=p5sagit%2Fp5-mst-13.2.git Integrate change #18420 from maint-5.8: Mea culpa: the join() was the string join, not the ithreads join(). p4raw-link: @18420 on //depot/maint-5.8/perl: dc2db835acbafd52ada4dd348b5bf804f5b81b3a p4raw-id: //depot/perl@18440 p4raw-integrated: from //depot/maint-5.8/perl@18439 'copy in' ext/threads/t/join.t (@18241..) --- diff --git a/ext/threads/t/join.t b/ext/threads/t/join.t index 230d70c..255704c 100644 --- a/ext/threads/t/join.t +++ b/ext/threads/t/join.t @@ -93,17 +93,19 @@ ok(1,""); 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 () { - 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; }