[Bps-public-commit] Scalar-Defer branch, master, updated. 0.22-2-g43140a5

jesse jesse at bestpractical.com
Wed Feb 17 10:04:33 EST 2010


The branch, master has been updated
       via  43140a5507d8554e48a45395c3133ee45cf3a9c4 (commit)
       via  fef32b6213af28e096fd4acb9e1c40eee5af2fff (commit)
      from  d772cc6d8c9c07b85dcc86925e8dd16f4ccd1509 (commit)

Summary of changes:
 Changes             |    4 ++++
 MANIFEST            |    1 +
 lib/Scalar/Defer.pm |    8 +++++++-
 t/04-threads.t      |   15 +++++++++++++++
 4 files changed, 27 insertions(+), 1 deletions(-)
 create mode 100644 t/04-threads.t

- Log -----------------------------------------------------------------
commit fef32b6213af28e096fd4acb9e1c40eee5af2fff
Author: Father Chrysostomos <sprout at cpan.org>
Date:   Wed Feb 17 07:03:01 2010 -0800

    If Scalar::Defer is loaded after a thread is created, no more threads
    can be started.
    
    The attached patch fixes this.

diff --git a/MANIFEST b/MANIFEST
index d0d2bf0..a03f042 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -26,3 +26,4 @@ SIGNATURE
 t/01-basic.t
 t/02-is.t
 t/03-autoload.t
+t/04-threads.t
diff --git a/lib/Scalar/Defer.pm b/lib/Scalar/Defer.pm
index 769bede..4f9d834 100644
--- a/lib/Scalar/Defer.pm
+++ b/lib/Scalar/Defer.pm
@@ -101,7 +101,10 @@ BEGIN {
     };
 
     {
-        foreach my $sym (grep { $_ ne 'DESTROY' and $_ ne 'DEMOLISH' and $_ ne 'BEGIN' and $_ ne 'END' and $_ ne 'AUTOLOAD' } keys %UNIVERSAL::) {
+        foreach my $sym (grep {
+             $_ ne 'DESTROY' and $_ ne 'DEMOLISH' and $_ ne 'BEGIN'
+         and $_ ne 'END' and $_ ne 'AUTOLOAD' and $_ ne 'CLONE_SKIP'
+        } keys %UNIVERSAL::) {
             my $code = q[
                 sub $sym {
                     if ( defined Scalar::Util::blessed($_[0]) ) {
@@ -109,6 +112,9 @@ BEGIN {
                         goto &{$_[0]->can("$sym")};
                     }
                     else {
+                        # Protect against future ALLCAPS methods
+                        return if $_[0] eq Scalar::Defer::DEFER_PACKAGE;
+
                         return shift->SUPER::$sym(@_);
                     }
                 }
diff --git a/t/04-threads.t b/t/04-threads.t
new file mode 100644
index 0000000..d48a54c
--- /dev/null
+++ b/t/04-threads.t
@@ -0,0 +1,15 @@
+use strict;
+use warnings;
+use Config;
+use Test::More;
+
+plan skip_all => 'this test requires threads' if !$Config{useithreads};
+
+plan tests => 1;
+
+require threads;
+create threads sub{}=>->join;
+require Scalar::Defer;
+create threads sub{}=>->join;
+
+pass();

commit 43140a5507d8554e48a45395c3133ee45cf3a9c4
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Feb 17 07:04:08 2010 -0800

    update CHANGES

diff --git a/Changes b/Changes
index ed82be2..248f051 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+[Changes for 0.23 - 0210-02-17]
+
+* Fix for [rt.cpan.org #54609] If Scalar::Defer is loaded after a thread is created, no more threads can be started. - SPROUT
+
 [Changes for 0.22 - 2010-01-29]
 
 * No code changes; note performance problems under 5.8.9

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list