@@ -5,7 +5,7 @@ use 5.008;
55use strict;
66use warnings;
77
8- our $VERSION = ' 1.18 ' ;
8+ our $VERSION = ' 1.19 ' ;
99my $XS_VERSION = $VERSION ;
1010$VERSION = eval $VERSION ;
1111
@@ -73,7 +73,7 @@ threads::shared - Perl extension for sharing data structures between threads
7373
7474=head1 VERSION
7575
76- This document describes threads::shared version 1.18
76+ This document describes threads::shared version 1.19
7777
7878=head1 SYNOPSIS
7979
@@ -362,6 +362,23 @@ error message. But the C<< $hashref->{key} >> is B<not> shared, causing the
362362error "locking can only be used on shared values" to occur when you attempt to
363363C<< lock($hasref->{key}) >>.
364364
365+ Using L<refaddr()|Scalar::Util/"refaddr EXPR"> ) is unreliable for testing
366+ whether or not two shared references are equivalent (e.g., when testing for
367+ circular references). Use L<is_shared()/"is_shared VARIABLE"> , instead:
368+
369+ use threads;
370+ use threads::shared;
371+ use Scalar::Util qw(refaddr);
372+
373+ # If ref is shared, use threads::shared's internal ID.
374+ # Otherwise, use refaddr().
375+ my $addr1 = is_shared($ref1) || refaddr($ref1);
376+ my $addr2 = is_shared($ref2) || refaddr($ref2);
377+
378+ if ($addr1 == $addr2) {
379+ # The refs are equivalent
380+ }
381+
365382View existing bug reports at, and submit any new bugs, problems, patches, etc.
366383to: L<http://rt.cpan.org/Public/Dist/Display.html?Name=threads-shared>
367384
@@ -371,7 +388,7 @@ L<threads::shared> Discussion Forum on CPAN:
371388L<http://www.cpanforum.com/dist/threads-shared>
372389
373390Annotated POD for L<threads::shared> :
374- L<http://annocpan.org/~JDHEDDEN/threads-shared-1.18 /shared.pm>
391+ L<http://annocpan.org/~JDHEDDEN/threads-shared-1.19 /shared.pm>
375392
376393Source repository:
377394L<http://code.google.com/p/threads-shared/>
0 commit comments