summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry D. Hedden <jdhedden@cpan.org>2009-11-23 10:34:04 -0500
committerJesse Vincent <jesse@bestpractical.com>2009-11-23 14:59:11 -0500
commit24855dffdf07c139d331fbdd811a1a8299756ee0 (patch)
tree8c2388254b6585a5eb9759747a60f97ab3d9e698
parente90d6148cab189f145114468e60a00cfb4e3ec90 (diff)
downloadperl-24855dffdf07c139d331fbdd811a1a8299756ee0.tar.gz
Upgrade to threads 1.75
-rwxr-xr-xPorting/Maintainers.pl2
-rwxr-xr-xdist/threads/Makefile.PL2
-rw-r--r--dist/threads/t/exit.t10
-rw-r--r--dist/threads/t/thread.t2
-rw-r--r--dist/threads/threads.pm6
-rwxr-xr-xdist/threads/threads.xs8
6 files changed, 17 insertions, 13 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index a0b4700eef..0942b9007f 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -1555,7 +1555,7 @@ use File::Glob qw(:case);
'threads' =>
{
'MAINTAINER' => 'jdhedden',
- 'DISTRIBUTION' => 'JDHEDDEN/threads-1.74.tar.gz',
+ 'DISTRIBUTION' => 'JDHEDDEN/threads-1.75.tar.gz',
'FILES' => q[dist/threads],
'EXCLUDED' => [ qw(examples/pool.pl
t/pod.t
diff --git a/dist/threads/Makefile.PL b/dist/threads/Makefile.PL
index b251797a42..cc70b658a0 100755
--- a/dist/threads/Makefile.PL
+++ b/dist/threads/Makefile.PL
@@ -80,7 +80,7 @@ WriteMakefile(
'PM' => {
'threads.pm' => '$(INST_LIBDIR)/threads.pm',
},
- 'INSTALLDIRS' => 'perl',
+ 'INSTALLDIRS' => (($] < 5.011) ? 'perl' : 'site'),
((ExtUtils::MakeMaker->VERSION() lt '6.25') ?
('PL_FILES' => { }) : ()),
diff --git a/dist/threads/t/exit.t b/dist/threads/t/exit.t
index 34f248a4db..bb1cec0d5b 100644
--- a/dist/threads/t/exit.t
+++ b/dist/threads/t/exit.t
@@ -48,7 +48,7 @@ my $rc = $thr->join();
ok(! defined($rc), 'Exited: threads->exit()');
-run_perl(prog => 'use threads 1.74;' .
+run_perl(prog => 'use threads 1.75;' .
'threads->exit(86);' .
'exit(99);',
nolib => ($ENV{PERL_CORE}) ? 0 : 1,
@@ -98,7 +98,7 @@ $rc = $thr->join();
ok(! defined($rc), 'Exited: $thr->set_thread_exit_only');
-run_perl(prog => 'use threads 1.74 qw(exit thread_only);' .
+run_perl(prog => 'use threads 1.75 qw(exit thread_only);' .
'threads->create(sub { exit(99); })->join();' .
'exit(86);',
nolib => ($ENV{PERL_CORE}) ? 0 : 1,
@@ -108,7 +108,7 @@ run_perl(prog => 'use threads 1.74 qw(exit thread_only);' .
is($?>>8, 86, "'use threads 'exit' => 'thread_only'");
}
-my $out = run_perl(prog => 'use threads 1.74;' .
+my $out = run_perl(prog => 'use threads 1.75;' .
'threads->create(sub {' .
' exit(99);' .
'});' .
@@ -124,7 +124,7 @@ my $out = run_perl(prog => 'use threads 1.74;' .
like($out, '1 finished and unjoined', "exit(status) in thread");
-$out = run_perl(prog => 'use threads 1.74 qw(exit thread_only);' .
+$out = run_perl(prog => 'use threads 1.75 qw(exit thread_only);' .
'threads->create(sub {' .
' threads->set_thread_exit_only(0);' .
' exit(99);' .
@@ -141,7 +141,7 @@ $out = run_perl(prog => 'use threads 1.74 qw(exit thread_only);' .
like($out, '1 finished and unjoined', "set_thread_exit_only(0)");
-run_perl(prog => 'use threads 1.74;' .
+run_perl(prog => 'use threads 1.75;' .
'threads->create(sub {' .
' $SIG{__WARN__} = sub { exit(99); };' .
' die();' .
diff --git a/dist/threads/t/thread.t b/dist/threads/t/thread.t
index b980c625c0..6f33cd4256 100644
--- a/dist/threads/t/thread.t
+++ b/dist/threads/t/thread.t
@@ -161,7 +161,7 @@ package main;
# bugid #24165
-run_perl(prog => 'use threads 1.74;' .
+run_perl(prog => 'use threads 1.75;' .
'sub a{threads->create(shift)} $t = a sub{};' .
'$t->tid; $t->join; $t->tid',
nolib => ($ENV{PERL_CORE}) ? 0 : 1,
diff --git a/dist/threads/threads.pm b/dist/threads/threads.pm
index 8b9b2d8990..4552e50959 100644
--- a/dist/threads/threads.pm
+++ b/dist/threads/threads.pm
@@ -5,7 +5,7 @@ use 5.008;
use strict;
use warnings;
-our $VERSION = '1.74';
+our $VERSION = '1.75';
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -134,7 +134,7 @@ threads - Perl interpreter-based threads
=head1 VERSION
-This document describes threads version 1.74
+This document describes threads version 1.75
=head1 SYNOPSIS
@@ -1021,7 +1021,7 @@ L<threads> Discussion Forum on CPAN:
L<http://www.cpanforum.com/dist/threads>
Annotated POD for L<threads>:
-L<http://annocpan.org/~JDHEDDEN/threads-1.74/threads.pm>
+L<http://annocpan.org/~JDHEDDEN/threads-1.75/threads.pm>
Source repository:
L<http://code.google.com/p/threads-shared/>
diff --git a/dist/threads/threads.xs b/dist/threads/threads.xs
index 5d98a59f2d..9e602a1bf4 100755
--- a/dist/threads/threads.xs
+++ b/dist/threads/threads.xs
@@ -680,8 +680,10 @@ S_ithread_create(
ithread *thread;
ithread *current_thread = S_ithread_get(aTHX);
+#if PERL_VERSION <= 8 && PERL_SUBVERSION <= 7
SV **tmps_tmp = PL_tmps_stack;
IV tmps_ix = PL_tmps_ix;
+#endif
#ifndef WIN32
int rc_stack_size = 0;
int rc_thread_create = 0;
@@ -787,12 +789,13 @@ S_ithread_create(
sv_copypv(thread->init_function, init_function);
} else {
thread->init_function =
- SvREFCNT_inc(sv_dup(init_function, &clone_param));
+ SvREFCNT_inc(sv_dup(init_function, &clone_param));
}
thread->params = sv_dup(params, &clone_param);
SvREFCNT_inc_void(thread->params);
+#if PERL_VERSION <= 8 && PERL_SUBVERSION <= 7
/* The code below checks that anything living on the tmps stack and
* has been cloned (so it lives in the ptr_table) has a refcount
* higher than 0.
@@ -805,7 +808,7 @@ S_ithread_create(
* Example of this can be found in bugreport 15837 where calls in the
* parameter list end up as a temp.
*
- * One could argue that this fix should be in perl_clone.
+ * As of 5.8.8 this is done in perl_clone.
*/
while (tmps_ix > 0) {
SV* sv = (SV*)ptr_table_fetch(PL_ptr_table, tmps_tmp[tmps_ix]);
@@ -815,6 +818,7 @@ S_ithread_create(
SvREFCNT_dec(sv);
}
}
+#endif
SvTEMP_off(thread->init_function);
ptr_table_free(PL_ptr_table);