From: Jerry D. Hedden Date: Mon, 23 Nov 2009 15:34:04 +0000 (-0500) Subject: Upgrade to threads 1.75 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=24855dffdf07c139d331fbdd811a1a8299756ee0;p=p5sagit%2Fp5-mst-13.2.git Upgrade to threads 1.75 --- diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index a0b4700..0942b90 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 b251797..cc70b65 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 34f248a..bb1cec0 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 b980c62..6f33cd4 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 8b9b2d8..4552e50 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 Discussion Forum on CPAN: L Annotated POD for L: -L +L Source repository: L diff --git a/dist/threads/threads.xs b/dist/threads/threads.xs index 5d98a59..9e602a1 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);