summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/dist/threads-shared/lib/threads
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2017-02-05 00:31:51 +0000
committerafresh1 <afresh1@openbsd.org>2017-02-05 00:31:51 +0000
commitb8851fcc53cbe24fd20b090f26dd149e353f6174 (patch)
tree4b7c1695865f00ab7a0da30b5632d514848ea3a2 /gnu/usr.bin/perl/dist/threads-shared/lib/threads
parentAdd option PCIVERBOSE. (diff)
downloadwireguard-openbsd-b8851fcc53cbe24fd20b090f26dd149e353f6174.tar.xz
wireguard-openbsd-b8851fcc53cbe24fd20b090f26dd149e353f6174.zip
Fix merge issues, remove excess files - match perl-5.24.1 dist
Diffstat (limited to 'gnu/usr.bin/perl/dist/threads-shared/lib/threads')
-rw-r--r--gnu/usr.bin/perl/dist/threads-shared/lib/threads/shared.pm15
1 files changed, 13 insertions, 2 deletions
diff --git a/gnu/usr.bin/perl/dist/threads-shared/lib/threads/shared.pm b/gnu/usr.bin/perl/dist/threads-shared/lib/threads/shared.pm
index bad2c412530..89a79a4864d 100644
--- a/gnu/usr.bin/perl/dist/threads-shared/lib/threads/shared.pm
+++ b/gnu/usr.bin/perl/dist/threads-shared/lib/threads/shared.pm
@@ -7,7 +7,7 @@ use warnings;
use Scalar::Util qw(reftype refaddr blessed);
-our $VERSION = '1.46'; # Please update the pod, too.
+our $VERSION = '1.51'; # Please update the pod, too.
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -195,7 +195,7 @@ threads::shared - Perl extension for sharing data structures between threads
=head1 VERSION
-This document describes threads::shared version 1.46
+This document describes threads::shared version 1.51
=head1 SYNOPSIS
@@ -558,6 +558,17 @@ they contain will be lost.
Therefore, populate such variables B<after> declaring them as shared. (Scalar
and scalar refs are not affected by this problem.)
+Blessing a shared item after it has been nested in another shared item does
+not propagate the blessing to the shared reference:
+
+ my $foo = &share({});
+ my $bar = &share({});
+ $bar->{foo} = $foo;
+ bless($foo, 'baz'); # $foo is now of class 'baz',
+ # but $bar->{foo} is unblessed.
+
+Therefore, you should bless objects before sharing them.
+
It is often not wise to share an object unless the class itself has been
written to support sharing. For example, an object's destructor may get
called multiple times, once for each thread's scope exit. Another danger is