pkgsrc/lang/perl5/patches/patch-ds
sno 216a511894 Updating lang/perl5 from 5.12.2 to 5.12.2nb1
pkgsrc changes:
- updating bundled modules
  * threads from 1.75 to 1.78
  * threads::shared from 1.32 to 1.33
  * Math::BigInt from 1.89_01 to 1.95 (without test merges)

Upstream changes of avove modules

>>> threads <<<
1.78 Wed Sep 22 17:21:22 2010
	- Handle missing signal handler in thread (threads bug #60460)

1.77 Fri Mar 26 13:36:33 2010
	- Fix race condition in t/threads.t (threads bug #55633)

1.76 Tue Mar  9 14:02:43 EST 2010
	- Handle magic on arg to ->object() (bug #73330)
	- Make ->object(threads->tid()) work like ->self() (bug #73330)
	- Noted memory consumption issue in POD
	- Added reusable thread pool example

>>> threads::shared <<<
1.33 Tue Mar  9 14:03:47 EST 2010
	- Handle shared object reference during global destruction
	- Document that changing array length via $#array doesn't work

>>> Math::BigInt <<<
2010-09-03 v1.90 rafl
 * fix bnok() for k==0 and k==n-1
2010-09-10 v1.91 rafl
 * fix various documentation bugs
2010-09-10 v1.92 rafl
 * re-upload v1.91 with a fixed SIGNATURE
2010-09-13 v1.93 rafl
 * Depend on perl >= 5.6.2
 * Remove obsolete core test directory boilerplate
 * Convert from Test to Test::More
2010-09-13 v1.94 rafl DEVELOPMENT RELEASE
 * Attempt to fix Math::BigInt::Lite failures
2010-09-14 v1.95 rafl
 * Re-upload v1.94 as a stable release
2010-09-23 21:47:48 +00:00

109 lines
3.6 KiB
Text

$NetBSD: patch-ds,v 1.1 2010/09/23 21:47:48 sno Exp $
Update of threads::shared to 1.33
--- dist/threads-shared/shared.pm.orig 2010-09-06 23:30:32.000000000 +0000
+++ dist/threads-shared/shared.pm
@@ -7,7 +7,7 @@ use warnings;
use Scalar::Util qw(reftype refaddr blessed);
-our $VERSION = '1.32';
+our $VERSION = '1.33';
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -187,7 +187,7 @@ threads::shared - Perl extension for sha
=head1 VERSION
-This document describes threads::shared version 1.32
+This document describes threads::shared version 1.33
=head1 SYNOPSIS
@@ -527,7 +527,8 @@ that the contents of hash-based objects
mentioned limitation. See F<examples/class.pl> (in the CPAN distribution of
this module) for how to create a class that supports object sharing.
-Does not support C<splice> on arrays!
+Does not support C<splice> on arrays. Does not support explicitly changing
+array lengths via $#array -- use C<push> and C<pop> instead.
Taking references to the elements of shared arrays and hashes does not
autovivify the elements, and neither does slicing a shared array/hash over
@@ -588,7 +589,7 @@ L<threads::shared> Discussion Forum on C
L<http://www.cpanforum.com/dist/threads-shared>
Annotated POD for L<threads::shared>:
-L<http://annocpan.org/~JDHEDDEN/threads-shared-1.32/shared.pm>
+L<http://annocpan.org/~JDHEDDEN/threads-shared-1.33/shared.pm>
Source repository:
L<http://code.google.com/p/threads-shared/>
--- dist/threads-shared/shared.xs.orig 2010-09-06 23:30:32.000000000 +0000
+++ dist/threads-shared/shared.xs
@@ -864,29 +864,32 @@ sharedsv_elem_mg_FETCH(pTHX_ SV *sv, MAG
{
dTHXc;
SV *saggregate = S_sharedsv_from_obj(aTHX_ mg->mg_obj);
- SV** svp;
+ SV** svp = NULL;
ENTER_LOCK;
- if (SvTYPE(saggregate) == SVt_PVAV) {
- assert ( mg->mg_ptr == 0 );
- SHARED_CONTEXT;
- svp = av_fetch((AV*) saggregate, mg->mg_len, 0);
- } else {
- char *key = mg->mg_ptr;
- I32 len = mg->mg_len;
- assert ( mg->mg_ptr != 0 );
- if (mg->mg_len == HEf_SVKEY) {
- STRLEN slen;
- key = SvPV((SV *)mg->mg_ptr, slen);
- len = slen;
- if (SvUTF8((SV *)mg->mg_ptr)) {
- len = -len;
+ if (saggregate) { /* During global destruction, underlying
+ aggregate may no longer exist */
+ if (SvTYPE(saggregate) == SVt_PVAV) {
+ assert ( mg->mg_ptr == 0 );
+ SHARED_CONTEXT;
+ svp = av_fetch((AV*) saggregate, mg->mg_len, 0);
+ } else {
+ char *key = mg->mg_ptr;
+ I32 len = mg->mg_len;
+ assert ( mg->mg_ptr != 0 );
+ if (mg->mg_len == HEf_SVKEY) {
+ STRLEN slen;
+ key = SvPV((SV *)mg->mg_ptr, slen);
+ len = slen;
+ if (SvUTF8((SV *)mg->mg_ptr)) {
+ len = -len;
+ }
}
+ SHARED_CONTEXT;
+ svp = hv_fetch((HV*) saggregate, key, len, 0);
}
- SHARED_CONTEXT;
- svp = hv_fetch((HV*) saggregate, key, len, 0);
+ CALLER_CONTEXT;
}
- CALLER_CONTEXT;
if (svp) {
/* Exists in the array */
if (SvROK(*svp)) {
@@ -957,6 +960,12 @@ sharedsv_elem_mg_DELETE(pTHX_ SV *sv, MA
dTHXc;
MAGIC *shmg;
SV *saggregate = S_sharedsv_from_obj(aTHX_ mg->mg_obj);
+
+ /* Object may not exist during global destruction */
+ if (! saggregate) {
+ return (0);
+ }
+
ENTER_LOCK;
sharedsv_elem_mg_FETCH(aTHX_ sv, mg);
if ((shmg = mg_find(sv, PERL_MAGIC_shared_scalar)))