summaryrefslogtreecommitdiff
path: root/lib/Carp.pm
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-07-19 04:29:34 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-07-19 04:29:34 +0000
commite8e6f333fb70a1ac62ee87237d37336cd6767150 (patch)
tree93317395fd445b9c7f669df43d6ec34908d8c550 /lib/Carp.pm
parentae96c66582f94c994a6ccb610abacedc1e3c40d6 (diff)
downloadperl-e8e6f333fb70a1ac62ee87237d37336cd6767150.tar.gz
don't display tid from main thread (or testsuite breaks)
p4raw-id: //depot/perl@3702
Diffstat (limited to 'lib/Carp.pm')
-rw-r--r--lib/Carp.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Carp.pm b/lib/Carp.pm
index 8301f37da7..364442436b 100644
--- a/lib/Carp.pm
+++ b/lib/Carp.pm
@@ -176,8 +176,10 @@ sub longmess {
# here's where the error message, $mess, gets constructed
$mess .= "\t$sub " if $error eq "called";
$mess .= "$error at $file line $line";
- $mess .= " thread " . Thread->self->tid
- if exists $main::{'Thread::'};
+ if (exists $main::{'Thread::'}) {
+ my $tid = Thread->self->tid;
+ $mess .= " thread $tid" if $tid;
+ }
$mess .= "\n";
}
# we don't need to print the actual error message again so we can
@@ -259,8 +261,10 @@ sub shortmess { # Short-circuit &longmess if called via multiple packages
# remove them first.
my $msg;
$msg = "$error at $file line $line";
- $msg .= " thread " . Thread->self->tid
- if exists $main::{'Thread::'};
+ if (exists $main::{'Thread::'}) {
+ my $tid = Thread->self->tid;
+ $mess .= " thread $tid" if $tid;
+ }
$msg .= "\n";
$msg =~ tr/\0//d;
return $msg;