summaryrefslogtreecommitdiff
path: root/ext/threads/threads.pm
diff options
context:
space:
mode:
authorElizabeth Mattijsen <liz@dijkmat.nl>2003-10-10 18:37:55 +0200
committerAbhijit Menon-Sen <ams@wiw.org>2003-10-10 19:05:55 +0000
commitabec23e71b5d54dc73752d78864a1da13b1510e0 (patch)
tree63596a6665f27309a7be2683877ef08e7bed036d /ext/threads/threads.pm
parent835f270a3e4bae7616085b997e93ab587be224b4 (diff)
downloadperl-abec23e71b5d54dc73752d78864a1da13b1510e0.tar.gz
threads::async + some cleanup
Message-Id: <p05111b07bbac713a0aaf@[192.168.56.2]> p4raw-id: //depot/perl@21436
Diffstat (limited to 'ext/threads/threads.pm')
-rwxr-xr-xext/threads/threads.pm14
1 files changed, 4 insertions, 10 deletions
diff --git a/ext/threads/threads.pm b/ext/threads/threads.pm
index 6709f633a9..e3c75c1a72 100755
--- a/ext/threads/threads.pm
+++ b/ext/threads/threads.pm
@@ -31,8 +31,6 @@ use overload
'==' => \&equal,
'fallback' => 1;
-#use threads::Shared;
-
BEGIN {
warn "Warning, threads::shared has already been loaded. ".
"To enable shared variables for these modules 'use threads' ".
@@ -55,15 +53,11 @@ async
our $VERSION = '1.00';
-sub equal {
- return 1 if($_[0]->tid() == $_[1]->tid());
- return 0;
-}
+# || 0 to ensure compatibility with previous versions
+sub equal { ($_[0]->tid == $_[1]->tid) || 0 }
-sub async (&;@) {
- my $cref = shift;
- return threads->new($cref,@_);
-}
+# use "goto" trick to avoid pad problems from 5.8.1, should also be faster
+sub async (&;@) { unshift @_,'threads'; goto &new }
sub object {
return undef unless @_ > 1;