r35797 - in /branches/upstream/libscope-upper-perl/current: Changes MANIFEST META.yml Makefile.PL README Upper.xs lib/Scope/Upper.pm t/01-import.t t/59-unwind-threads.t t/90-boilerplate.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Tue May 19 05:02:54 UTC 2009
Author: jawnsy-guest
Date: Tue May 19 05:02:48 2009
New Revision: 35797
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=35797
Log:
[svn-upgrade] Integrating new upstream version, libscope-upper-perl (0.09)
Removed:
branches/upstream/libscope-upper-perl/current/t/90-boilerplate.t
Modified:
branches/upstream/libscope-upper-perl/current/Changes
branches/upstream/libscope-upper-perl/current/MANIFEST
branches/upstream/libscope-upper-perl/current/META.yml
branches/upstream/libscope-upper-perl/current/Makefile.PL
branches/upstream/libscope-upper-perl/current/README
branches/upstream/libscope-upper-perl/current/Upper.xs
branches/upstream/libscope-upper-perl/current/lib/Scope/Upper.pm
branches/upstream/libscope-upper-perl/current/t/01-import.t
branches/upstream/libscope-upper-perl/current/t/59-unwind-threads.t
Modified: branches/upstream/libscope-upper-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscope-upper-perl/current/Changes?rev=35797&op=diff
==============================================================================
--- branches/upstream/libscope-upper-perl/current/Changes (original)
+++ branches/upstream/libscope-upper-perl/current/Changes Tue May 19 05:02:48 2009
@@ -1,4 +1,11 @@
Revision history for Scope-Upper
+
+0.09 2009-05-17 20:20 UTC
+ + Add : The new SU_THREADSAFE constant can be used to know whether the
+ module could have been built with thread safety enabled.
+ + Chg : Thread safety is disabled for perl 5.8 on Win32.
+ + Chg : A saner workaround for the "call_sv() during LEAVE clobbers the
+ still used last popped stack element" issue on 5.10.
0.08 2009-04-16 22:50 UTC
+ Fix : [RT #44204] : Stack corruption with reap(). Thanks Torsten
Modified: branches/upstream/libscope-upper-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscope-upper-perl/current/MANIFEST?rev=35797&op=diff
==============================================================================
--- branches/upstream/libscope-upper-perl/current/MANIFEST (original)
+++ branches/upstream/libscope-upper-perl/current/MANIFEST Tue May 19 05:02:48 2009
@@ -1,5 +1,6 @@
Changes
MANIFEST
+META.yml
Makefile.PL
README
Upper.xs
@@ -33,10 +34,8 @@
t/59-unwind-threads.t
t/81-stress-level.t
t/85-stress-unwind.t
-t/90-boilerplate.t
t/91-pod.t
t/92-pod-coverage.t
t/95-portability-files.t
t/99-kwalitee.t
t/lib/Scope/Upper/TestGenerator.pm
-META.yml Module meta-data (added by MakeMaker)
Modified: branches/upstream/libscope-upper-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscope-upper-perl/current/META.yml?rev=35797&op=diff
==============================================================================
--- branches/upstream/libscope-upper-perl/current/META.yml (original)
+++ branches/upstream/libscope-upper-perl/current/META.yml Tue May 19 05:02:48 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Scope-Upper
-version: 0.08
+version: 0.09
abstract: Act on upper scopes.
author:
- Vincent Pit <perl at profvince.com>
@@ -19,7 +19,7 @@
bugtracker: http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Scope-Upper
homepage: http://search.cpan.org/dist/Scope-Upper/
license: http://dev.perl.org/licenses/
- repository: http://git.profvince.com/?p=perl/modules/Scope-Upper.git
+ repository: http://git.profvince.com/?p=perl%2Fmodules%2FScope-Upper.git
no_index:
directory:
- t
Modified: branches/upstream/libscope-upper-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscope-upper-perl/current/Makefile.PL?rev=35797&op=diff
==============================================================================
--- branches/upstream/libscope-upper-perl/current/Makefile.PL (original)
+++ branches/upstream/libscope-upper-perl/current/Makefile.PL Tue May 19 05:02:48 2009
@@ -1,6 +1,17 @@
+use 5.006;
+
use strict;
use warnings;
use ExtUtils::MakeMaker;
+
+my @DEFINES;
+
+# Threads, Windows and 5.8.x don't seem to be best friends
+if ($^O eq 'MSWin32' && $^V lt v5.9.0) {
+ push @DEFINES, '-DSU_MULTIPLICITY=0';
+}
+
+ at DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
my $dist = 'Scope-Upper';
@@ -16,7 +27,7 @@
bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
homepage => "http://search.cpan.org/dist/$dist/",
license => 'http://dev.perl.org/licenses/',
- repository => "http://git.profvince.com/?p=perl/modules/$dist.git",
+ repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
},
);
@@ -27,6 +38,7 @@
VERSION_FROM => 'lib/Scope/Upper.pm',
ABSTRACT_FROM => 'lib/Scope/Upper.pm',
PL_FILES => {},
+ @DEFINES,
PREREQ_PM => {
'Exporter' => 0,
'XSLoader' => 0,
Modified: branches/upstream/libscope-upper-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscope-upper-perl/current/README?rev=35797&op=diff
==============================================================================
--- branches/upstream/libscope-upper-perl/current/README (original)
+++ branches/upstream/libscope-upper-perl/current/README Tue May 19 05:02:48 2009
@@ -2,7 +2,7 @@
Scope::Upper - Act on upper scopes.
VERSION
- Version 0.08
+ Version 0.09
SYNOPSIS
package X;
@@ -171,6 +171,10 @@
}->();
will righteously set $num to 26.
+
+CONSTANTS
+ "SU_THREADSAFE"
+ True iff the module could have been built when thread-safety features.
WORDS
Constants
@@ -272,6 +276,9 @@
"unwind" and "want_at" are only exported on request, either individually
or by the tags ':funcs' and ':all'.
+ The constant "SU_THREADSAFE" is also only exported on request,
+ individually or by the tags ':consts' and ':all'.
+
Same goes for the words "TOP", "HERE", "UP", "SUB", "EVAL", "SCOPE" and
"CALLER" that are only exported on request, individually or by the tags
':words' and ':all'.
Modified: branches/upstream/libscope-upper-perl/current/Upper.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscope-upper-perl/current/Upper.xs?rev=35797&op=diff
==============================================================================
--- branches/upstream/libscope-upper-perl/current/Upper.xs (original)
+++ branches/upstream/libscope-upper-perl/current/Upper.xs Tue May 19 05:02:48 2009
@@ -277,8 +277,10 @@
STATIC void su_call(pTHX_ void *ud_) {
su_ud_reap *ud = (su_ud_reap *) ud_;
-#if SU_HAS_PERL(5, 10, 0)
+#if SU_HAS_PERL(5, 9, 5)
+ PERL_CONTEXT saved_cx;
I32 dieing = PL_op->op_type == OP_DIE;
+ I32 cxix;
#endif
dSP;
@@ -291,23 +293,24 @@
PUSHMARK(SP);
PUTBACK;
- /* If cxstack_ix isn't incremented there, the eval context will be overwritten
- * when the new sub scope will be created in call_sv. */
-
-#if SU_HAS_PERL(5, 10, 0)
+ /* If the recently popped context isn't saved there, it will be overwritten by
+ * the sub scope from call_sv, although it's still needed in our caller. */
+
+#if SU_HAS_PERL(5, 9, 5)
if (dieing) {
if (cxstack_ix < cxstack_max)
- ++cxstack_ix;
+ cxix = cxstack_ix + 1;
else
- cxstack_ix = Perl_cxinc(aTHX);
+ cxix = Perl_cxinc(aTHX);
+ saved_cx = cxstack[cxix];
}
#endif
call_sv(ud->cb, G_VOID);
-#if SU_HAS_PERL(5, 10, 0)
- if (dieing && cxstack_ix > 0)
- --cxstack_ix;
+#if SU_HAS_PERL(5, 9, 5)
+ if (dieing)
+ cxstack[cxix] = saved_cx;
#endif
PUTBACK;
@@ -717,7 +720,8 @@
HV *stash;
MY_CXT_INIT;
stash = gv_stashpv(__PACKAGE__, 1);
- newCONSTSUB(stash, "TOP", newSViv(0));
+ newCONSTSUB(stash, "TOP", newSViv(0));
+ newCONSTSUB(stash, "SU_THREADSAFE", newSVuv(SU_THREADSAFE));
newXSproto("Scope::Upper::unwind", XS_Scope__Upper_unwind, file, NULL);
}
Modified: branches/upstream/libscope-upper-perl/current/lib/Scope/Upper.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscope-upper-perl/current/lib/Scope/Upper.pm?rev=35797&op=diff
==============================================================================
--- branches/upstream/libscope-upper-perl/current/lib/Scope/Upper.pm (original)
+++ branches/upstream/libscope-upper-perl/current/lib/Scope/Upper.pm Tue May 19 05:02:48 2009
@@ -9,13 +9,13 @@
=head1 VERSION
-Version 0.08
+Version 0.09
=cut
our $VERSION;
BEGIN {
- $VERSION = '0.08';
+ $VERSION = '0.09';
}
=head1 SYNOPSIS
@@ -210,6 +210,12 @@
}->();
will righteously set C<$num> to C<26>.
+
+=head1 CONSTANTS
+
+=head2 C<SU_THREADSAFE>
+
+True iff the module could have been built when thread-safety features.
=head1 WORDS
@@ -318,6 +324,8 @@
The functions L</reap>, L</localize>, L</localize_elem>, L</localize_delete>, L</unwind> and L</want_at> are only exported on request, either individually or by the tags C<':funcs'> and C<':all'>.
+The constant L</SU_THREADSAFE> is also only exported on request, individually or by the tags C<':consts'> and C<':all'>.
+
Same goes for the words L</TOP>, L</HERE>, L</UP>, L</SUB>, L</EVAL>, L</SCOPE> and L</CALLER> that are only exported on request, individually or by the tags C<':words'> and C<':all'>.
=cut
@@ -326,8 +334,9 @@
our @EXPORT = ();
our %EXPORT_TAGS = (
- funcs => [ qw/reap localize localize_elem localize_delete unwind want_at/ ],
- words => [ qw/TOP HERE UP SUB EVAL SCOPE CALLER/ ],
+ funcs => [ qw/reap localize localize_elem localize_delete unwind want_at/ ],
+ words => [ qw/TOP HERE UP SUB EVAL SCOPE CALLER/ ],
+ consts => [ qw/SU_THREADSAFE/ ],
);
our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
$EXPORT_TAGS{'all'} = [ @EXPORT_OK ];
Modified: branches/upstream/libscope-upper-perl/current/t/01-import.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscope-upper-perl/current/t/01-import.t?rev=35797&op=diff
==============================================================================
--- branches/upstream/libscope-upper-perl/current/t/01-import.t (original)
+++ branches/upstream/libscope-upper-perl/current/t/01-import.t Tue May 19 05:02:48 2009
@@ -3,11 +3,29 @@
use strict;
use warnings;
-use Test::More tests => 13;
+use Test::More tests => 2 * 14;
require Scope::Upper;
-for (qw/reap localize localize_elem localize_delete unwind want_at TOP HERE UP SUB EVAL SCOPE CALLER/) {
+my %syms = (
+ reap => '&;$',
+ localize => '$$;$',
+ localize_elem => '$$$;$',
+ localize_delete => '$$;$',
+ unwind => undef,
+ want_at => ';$',
+ TOP => '',
+ HERE => '',
+ UP => ';$',
+ SUB => ';$',
+ EVAL => ';$',
+ SCOPE => ';$',
+ CALLER => ';$',
+ SU_THREADSAFE => '',
+);
+
+for (keys %syms) {
eval { Scope::Upper->import($_) };
- is($@, '', 'import ' . $_);
+ is $@, '', "import $_";
+ is prototype($_), $syms{$_}, "prototype $_";
}
Modified: branches/upstream/libscope-upper-perl/current/t/59-unwind-threads.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscope-upper-perl/current/t/59-unwind-threads.t?rev=35797&op=diff
==============================================================================
--- branches/upstream/libscope-upper-perl/current/t/59-unwind-threads.t (original)
+++ branches/upstream/libscope-upper-perl/current/t/59-unwind-threads.t Tue May 19 05:02:48 2009
@@ -17,14 +17,16 @@
skipall 'threads required to test thread safety' unless eval "use threads; 1";
}
+use Test::More;
+
+use Scope::Upper qw/unwind UP SU_THREADSAFE/;
+
my $num;
-BEGIN { $num = 20; }
-
-use Test::More tests => $num;
BEGIN {
+ skipall 'This Scope::Upper isn\'t thread safe' unless SU_THREADSAFE;
+ plan tests => ($num = 30);
defined and diag "Using threads $_" for $threads::VERSION;
-
if (eval "use Time::HiRes; 1") {
defined and diag "Using Time::HiRes $_" for $Time::HiRes::VERSION;
*usleep = \&Time::HiRes::usleep;
@@ -37,12 +39,7 @@
}
}
-use Scope::Upper qw/unwind UP/;
-
our $z;
-
-BEGIN {
-}
sub up1 {
my $tid = threads->tid();
More information about the Pkg-perl-cvs-commits
mailing list