Skip to content

Commit 24855df

Browse files
jdheddenobra
authored andcommitted
Upgrade to threads 1.75
1 parent e90d614 commit 24855df

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

Porting/Maintainers.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ package Maintainers;
15551555
'threads' =>
15561556
{
15571557
'MAINTAINER' => 'jdhedden',
1558-
'DISTRIBUTION' => 'JDHEDDEN/threads-1.74.tar.gz',
1558+
'DISTRIBUTION' => 'JDHEDDEN/threads-1.75.tar.gz',
15591559
'FILES' => q[dist/threads],
15601560
'EXCLUDED' => [ qw(examples/pool.pl
15611561
t/pod.t

dist/threads/Makefile.PL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ WriteMakefile(
8080
'PM' => {
8181
'threads.pm' => '$(INST_LIBDIR)/threads.pm',
8282
},
83-
'INSTALLDIRS' => 'perl',
83+
'INSTALLDIRS' => (($] < 5.011) ? 'perl' : 'site'),
8484

8585
((ExtUtils::MakeMaker->VERSION() lt '6.25') ?
8686
('PL_FILES' => { }) : ()),

dist/threads/t/exit.t

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ my $rc = $thr->join();
4848
ok(! defined($rc), 'Exited: threads->exit()');
4949

5050

51-
run_perl(prog => 'use threads 1.74;' .
51+
run_perl(prog => 'use threads 1.75;' .
5252
'threads->exit(86);' .
5353
'exit(99);',
5454
nolib => ($ENV{PERL_CORE}) ? 0 : 1,
@@ -98,7 +98,7 @@ $rc = $thr->join();
9898
ok(! defined($rc), 'Exited: $thr->set_thread_exit_only');
9999

100100

101-
run_perl(prog => 'use threads 1.74 qw(exit thread_only);' .
101+
run_perl(prog => 'use threads 1.75 qw(exit thread_only);' .
102102
'threads->create(sub { exit(99); })->join();' .
103103
'exit(86);',
104104
nolib => ($ENV{PERL_CORE}) ? 0 : 1,
@@ -108,7 +108,7 @@ run_perl(prog => 'use threads 1.74 qw(exit thread_only);' .
108108
is($?>>8, 86, "'use threads 'exit' => 'thread_only'");
109109
}
110110

111-
my $out = run_perl(prog => 'use threads 1.74;' .
111+
my $out = run_perl(prog => 'use threads 1.75;' .
112112
'threads->create(sub {' .
113113
' exit(99);' .
114114
'});' .
@@ -124,7 +124,7 @@ my $out = run_perl(prog => 'use threads 1.74;' .
124124
like($out, '1 finished and unjoined', "exit(status) in thread");
125125

126126

127-
$out = run_perl(prog => 'use threads 1.74 qw(exit thread_only);' .
127+
$out = run_perl(prog => 'use threads 1.75 qw(exit thread_only);' .
128128
'threads->create(sub {' .
129129
' threads->set_thread_exit_only(0);' .
130130
' exit(99);' .
@@ -141,7 +141,7 @@ $out = run_perl(prog => 'use threads 1.74 qw(exit thread_only);' .
141141
like($out, '1 finished and unjoined', "set_thread_exit_only(0)");
142142

143143

144-
run_perl(prog => 'use threads 1.74;' .
144+
run_perl(prog => 'use threads 1.75;' .
145145
'threads->create(sub {' .
146146
' $SIG{__WARN__} = sub { exit(99); };' .
147147
' die();' .

dist/threads/t/thread.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ package main;
161161

162162
# bugid #24165
163163

164-
run_perl(prog => 'use threads 1.74;' .
164+
run_perl(prog => 'use threads 1.75;' .
165165
'sub a{threads->create(shift)} $t = a sub{};' .
166166
'$t->tid; $t->join; $t->tid',
167167
nolib => ($ENV{PERL_CORE}) ? 0 : 1,

dist/threads/threads.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use 5.008;
55
use strict;
66
use warnings;
77

8-
our $VERSION = '1.74';
8+
our $VERSION = '1.75';
99
my $XS_VERSION = $VERSION;
1010
$VERSION = eval $VERSION;
1111

@@ -134,7 +134,7 @@ threads - Perl interpreter-based threads
134134
135135
=head1 VERSION
136136
137-
This document describes threads version 1.74
137+
This document describes threads version 1.75
138138
139139
=head1 SYNOPSIS
140140
@@ -1021,7 +1021,7 @@ L<threads> Discussion Forum on CPAN:
10211021
L<http://www.cpanforum.com/dist/threads>
10221022
10231023
Annotated POD for L<threads>:
1024-
L<http://annocpan.org/~JDHEDDEN/threads-1.74/threads.pm>
1024+
L<http://annocpan.org/~JDHEDDEN/threads-1.75/threads.pm>
10251025
10261026
Source repository:
10271027
L<http://code.google.com/p/threads-shared/>

dist/threads/threads.xs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,10 @@ S_ithread_create(
680680
ithread *thread;
681681
ithread *current_thread = S_ithread_get(aTHX);
682682

683+
#if PERL_VERSION <= 8 && PERL_SUBVERSION <= 7
683684
SV **tmps_tmp = PL_tmps_stack;
684685
IV tmps_ix = PL_tmps_ix;
686+
#endif
685687
#ifndef WIN32
686688
int rc_stack_size = 0;
687689
int rc_thread_create = 0;
@@ -787,12 +789,13 @@ S_ithread_create(
787789
sv_copypv(thread->init_function, init_function);
788790
} else {
789791
thread->init_function =
790-
SvREFCNT_inc(sv_dup(init_function, &clone_param));
792+
SvREFCNT_inc(sv_dup(init_function, &clone_param));
791793
}
792794

793795
thread->params = sv_dup(params, &clone_param);
794796
SvREFCNT_inc_void(thread->params);
795797

798+
#if PERL_VERSION <= 8 && PERL_SUBVERSION <= 7
796799
/* The code below checks that anything living on the tmps stack and
797800
* has been cloned (so it lives in the ptr_table) has a refcount
798801
* higher than 0.
@@ -805,7 +808,7 @@ S_ithread_create(
805808
* Example of this can be found in bugreport 15837 where calls in the
806809
* parameter list end up as a temp.
807810
*
808-
* One could argue that this fix should be in perl_clone.
811+
* As of 5.8.8 this is done in perl_clone.
809812
*/
810813
while (tmps_ix > 0) {
811814
SV* sv = (SV*)ptr_table_fetch(PL_ptr_table, tmps_tmp[tmps_ix]);
@@ -815,6 +818,7 @@ S_ithread_create(
815818
SvREFCNT_dec(sv);
816819
}
817820
}
821+
#endif
818822

819823
SvTEMP_off(thread->init_function);
820824
ptr_table_free(PL_ptr_table);

0 commit comments

Comments
 (0)