Change 34928 by [EMAIL PROTECTED] on 2008/11/26 20:36:49

        Integrate:
        [ 34916]
        Integrate:
        [ 34915]
        Subject: [PATCH] threads::shared 1.27
        From: "Jerry D. Hedden" <[EMAIL PROTECTED]>
        Message-ID: <[EMAIL PROTECTED]>
        Date: Tue, 25 Nov 2008 11:52:12 -0500

Affected files ...

... //depot/maint-5.8/perl/ext/threads/shared/Makefile.PL#5 integrate
... //depot/maint-5.8/perl/ext/threads/shared/shared.pm#20 integrate
... //depot/maint-5.8/perl/ext/threads/shared/t/waithires.t#4 integrate

Differences ...

==== //depot/maint-5.8/perl/ext/threads/shared/Makefile.PL#5 (xtext) ====
Index: perl/ext/threads/shared/Makefile.PL
--- perl/ext/threads/shared/Makefile.PL#4~33931~        2008-05-25 
15:45:48.000000000 -0700
+++ perl/ext/threads/shared/Makefile.PL 2008-11-26 12:36:49.000000000 -0800
@@ -66,6 +66,7 @@
                                     'Carp'              => 0,
                                     'XSLoader'          => 0,
                                     'Scalar::Util'      => 0,
+                                    'threads'           => 1.71,
 
                                     'Test'              => 0,
                                     'Test::More'        => 0,

==== //depot/maint-5.8/perl/ext/threads/shared/shared.pm#20 (text) ====
Index: perl/ext/threads/shared/shared.pm
--- perl/ext/threads/shared/shared.pm#19~34281~ 2008-09-05 13:42:50.000000000 
-0700
+++ perl/ext/threads/shared/shared.pm   2008-11-26 12:36:49.000000000 -0800
@@ -7,7 +7,7 @@
 
 use Scalar::Util qw(reftype refaddr blessed);
 
-our $VERSION = '1.26';
+our $VERSION = '1.27';
 my $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 
@@ -187,7 +187,7 @@
 
 =head1 VERSION
 
-This document describes threads::shared version 1.26
+This document describes threads::shared version 1.27
 
 =head1 SYNOPSIS
 
@@ -294,7 +294,7 @@
 =item shared_clone REF
 
 C<shared_clone> takes a reference, and returns a shared version of its
-argument, preforming a deep copy on any non-shared elements.  Any shared
+argument, performing a deep copy on any non-shared elements.  Any shared
 elements in the argument are used as is (i.e., they are not cloned).
 
   my $cpy = shared_clone({'foo' => [qw/foo bar baz/]});
@@ -308,8 +308,8 @@
 
 For cloning empty array or hash refs, the following may also be used:
 
-  $var = &share([]);   # Same as $var = share_clone([]);
-  $var = &share({});   # Same as $var = share_clone({});
+  $var = &share([]);   # Same as $var = shared_clone([]);
+  $var = &share({});   # Same as $var = shared_clone({});
 
 =item is_shared VARIABLE
 
@@ -532,6 +532,28 @@
         # The refs are equivalent
     }
 
+L<each()|perlfunc/"each HASH"> does not work properly on shared references
+embedded in shared structures.  For example:
+
+    my %foo :shared;
+    $foo{'bar'} = shared_clone({'a'=>'x', 'b'=>'y', 'c'=>'z'});
+
+    while (my ($key, $val) = each(%{$foo{'bar'}})) {
+        ...
+    }
+
+Either of the following will work instead:
+
+    my $ref = $foo{'bar'};
+    while (my ($key, $val) = each(%{$ref})) {
+        ...
+    }
+
+    foreach my $key (keys(%{$foo{'bar'}})) {
+        my $val = $foo{'bar'}{$key};
+        ...
+    }
+
 View existing bug reports at, and submit any new bugs, problems, patches, etc.
 to: L<http://rt.cpan.org/Public/Dist/Display.html?Name=threads-shared>
 
@@ -541,7 +563,7 @@
 L<http://www.cpanforum.com/dist/threads-shared>
 
 Annotated POD for L<threads::shared>:
-L<http://annocpan.org/~JDHEDDEN/threads-shared-1.26/shared.pm>
+L<http://annocpan.org/~JDHEDDEN/threads-shared-1.27/shared.pm>
 
 Source repository:
 L<http://code.google.com/p/threads-shared/>

==== //depot/maint-5.8/perl/ext/threads/shared/t/waithires.t#4 (text) ====
Index: perl/ext/threads/shared/t/waithires.t
--- perl/ext/threads/shared/t/waithires.t#3~34281~      2008-09-05 
13:42:50.000000000 -0700
+++ perl/ext/threads/shared/t/waithires.t       2008-11-26 12:36:49.000000000 
-0800
@@ -18,11 +18,9 @@
         Test::skip_all(q/Perl not compiled with 'useithreads'/);
     }
 
-    eval {
-        require Time::HiRes;
-        Time::HiRes->import('time');
-    };
-    Test::skip_all('Time::HiRes not available') if ($@);
+    if (! eval 'use Time::HiRes "time"; 1') {
+        Test::skip_all('Time::HiRes not available');
+    }
 }
 
 use ExtUtils::testlib;
End of Patch.

Reply via email to