Skip to content

Commit

Permalink
Merge pull request #7 from Dual-Life/develop
Browse files Browse the repository at this point in the history
2.14 Sync with blead
  • Loading branch information
jdhedden authored Feb 26, 2017
2 parents 4b0f2d1 + 11d14c7 commit dbad48e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Revision history for Perl extension threads.
-
-

2.14 Sun Feb 26 21:14:26 2017
- Sync from blead

2.13 Sun Feb 26 17:59:01 2017
- Added t/kill3.t to test that dir handles are thread-safe

Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
threads version 2.13
threads version 2.14
====================

This module exposes interpreter threads to the Perl level.
Expand Down
4 changes: 2 additions & 2 deletions lib/threads.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use 5.008;
use strict;
use warnings;

our $VERSION = '2.13';
our $VERSION = '2.14';
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;

Expand Down Expand Up @@ -134,7 +134,7 @@ threads - Perl interpreter-based threads
=head1 VERSION
This document describes threads version 2.13
This document describes threads version 2.14
=head1 WARNING
Expand Down
10 changes: 5 additions & 5 deletions t/exit.t
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ my $rc = $thr->join();
ok(! defined($rc), 'Exited: threads->exit()');


run_perl(prog => 'use threads 2.13;' .
run_perl(prog => 'use threads 2.14;' .
'threads->exit(86);' .
'exit(99);',
nolib => ($ENV{PERL_CORE}) ? 0 : 1,
Expand Down Expand Up @@ -98,7 +98,7 @@ $rc = $thr->join();
ok(! defined($rc), 'Exited: $thr->set_thread_exit_only');


run_perl(prog => 'use threads 2.13 qw(exit thread_only);' .
run_perl(prog => 'use threads 2.14 qw(exit thread_only);' .
'threads->create(sub { exit(99); })->join();' .
'exit(86);',
nolib => ($ENV{PERL_CORE}) ? 0 : 1,
Expand All @@ -108,7 +108,7 @@ run_perl(prog => 'use threads 2.13 qw(exit thread_only);' .
is($?>>8, 86, "'use threads 'exit' => 'thread_only'");
}

my $out = run_perl(prog => 'use threads 2.13;' .
my $out = run_perl(prog => 'use threads 2.14;' .
'threads->create(sub {' .
' exit(99);' .
'});' .
Expand All @@ -124,7 +124,7 @@ my $out = run_perl(prog => 'use threads 2.13;' .
like($out, qr/1 finished and unjoined/, "exit(status) in thread");


$out = run_perl(prog => 'use threads 2.13 qw(exit thread_only);' .
$out = run_perl(prog => 'use threads 2.14 qw(exit thread_only);' .
'threads->create(sub {' .
' threads->set_thread_exit_only(0);' .
' exit(99);' .
Expand All @@ -141,7 +141,7 @@ $out = run_perl(prog => 'use threads 2.13 qw(exit thread_only);' .
like($out, qr/1 finished and unjoined/, "set_thread_exit_only(0)");


run_perl(prog => 'use threads 2.13;' .
run_perl(prog => 'use threads 2.14;' .
'threads->create(sub {' .
' $SIG{__WARN__} = sub { exit(99); };' .
' die();' .
Expand Down
14 changes: 10 additions & 4 deletions t/kill3.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ BEGIN {
}

use ExtUtils::testlib;
use File::Path ();
use File::Spec;
use Cwd;
my $cwd = cwd();

Expand All @@ -35,8 +37,9 @@ BEGIN {
{
$SIG{'KILL'} = undef;
chdir '/tmp';
mkdir "toberead$$";
chdir "toberead$$";
my $dir = File::Spec->catdir( '/tmp', "toberead$$" );
mkdir $dir;
chdir $dir;
for ('a'..'e') {
open my $THING, ">$_";
close $THING or die "$_: $!";
Expand Down Expand Up @@ -69,13 +72,15 @@ BEGIN {
}
print($@ ? 'not ok' : 'ok');
EOI
File::Path::rmtree($dir);
}

{
$SIG{'KILL'} = undef;
chdir '/tmp';
mkdir "shouldberead$$";
chdir "shouldberead$$";
my $dir = File::Spec->catdir( '/tmp', "shouldberead$$" );
mkdir $dir;
chdir $dir;
for ('a'..'e') {
open my $THING, ">$_";
close $THING or die "$_: $!";
Expand Down Expand Up @@ -108,6 +113,7 @@ EOI
}
print($@ ? 'not ok' : 'ok');
EOI
File::Path::rmtree($dir);
}

exit(0);
2 changes: 1 addition & 1 deletion t/thread.t
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ package main;

# bugid #24165

run_perl(prog => 'use threads 2.13;' .
run_perl(prog => 'use threads 2.14;' .
'sub a{threads->create(shift)} $t = a sub{};' .
'$t->tid; $t->join; $t->tid',
nolib => ($ENV{PERL_CORE}) ? 0 : 1,
Expand Down

0 comments on commit dbad48e

Please sign in to comment.