summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-01-04 16:31:31 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-01-04 16:31:31 +0000
commitc8c7fdd1a93cac2b3a20ec43fed0b1327c000811 (patch)
tree6b424fe71e27565574a4c2e31ed8a2a4ddb72d99 /ext
parentc72f2af0de9e34a7fac1a22285e602882b257035 (diff)
downloadperl-c8c7fdd1a93cac2b3a20ec43fed0b1327c000811.tar.gz
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..)
Diffstat (limited to 'ext')
-rw-r--r--ext/threads/t/join.t20
1 files changed, 11 insertions, 9 deletions
diff --git a/ext/threads/t/join.t b/ext/threads/t/join.t
index 230d70c545..255704cb34 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 (<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;
}