summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdhedden <jdhedden@cpan.org>2016-04-22 19:23:01 -0400
committerRicardo Signes <rjbs@cpan.org>2016-04-30 14:30:07 -0400
commit3cfebacc8397adeec781a138c311ff4f37e5b601 (patch)
treefdc04cd71232e731ee76cbe3deef9f94548070b7
parentd9262b38948c21dc22d00f0f094ad37ee3b98430 (diff)
downloadperl-3cfebacc8397adeec781a138c311ff4f37e5b601.tar.gz
Upgrade to threads::shared 1.51
-rwxr-xr-xPorting/Maintainers.pl2
-rw-r--r--dist/threads-shared/lib/threads/shared.pm15
-rw-r--r--dist/threads-shared/shared.xs14
3 files changed, 14 insertions, 17 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index 65e16026da..7e97a87f8f 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -1199,7 +1199,7 @@ use File::Glob qw(:case);
},
'threads::shared' => {
- 'DISTRIBUTION' => 'JDHEDDEN/threads-shared-1.48.tar.gz',
+ 'DISTRIBUTION' => 'JDHEDDEN/threads-shared-1.51.tar.gz',
'FILES' => q[dist/threads-shared],
'EXCLUDED' => [
qw( examples/class.pl
diff --git a/dist/threads-shared/lib/threads/shared.pm b/dist/threads-shared/lib/threads/shared.pm
index dc76ab269d..89a79a4864 100644
--- a/dist/threads-shared/lib/threads/shared.pm
+++ b/dist/threads-shared/lib/threads/shared.pm
@@ -7,7 +7,7 @@ use warnings;
use Scalar::Util qw(reftype refaddr blessed);
-our $VERSION = '1.50'; # 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.48
+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
diff --git a/dist/threads-shared/shared.xs b/dist/threads-shared/shared.xs
index e323788248..a019732af8 100644
--- a/dist/threads-shared/shared.xs
+++ b/dist/threads-shared/shared.xs
@@ -1166,20 +1166,6 @@ const MGVTBL sharedsv_array_vtbl = {
};
-#if 0
-/* XXX unused dead code */
-/* Recursively unlocks a shared sv. */
-
-static void
-Perl_sharedsv_unlock(pTHX_ SV *ssv)
-{
- user_lock *ul = S_get_userlock(aTHX_ ssv, 0);
- assert(ul);
- recursive_lock_release(aTHX_ &ul->lock);
-}
-#endif
-
-
/* Recursive locks on a sharedsv.
* Locks are dynamically scoped at the level of the first lock.
*/