diff options
author | Jerry D. Hedden <jdhedden@cpan.org> | 2008-02-22 11:26:21 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-02-25 06:45:05 +0000 |
commit | 7ef93cb2ba7dd1718be26a5d315eca2414c7da42 (patch) | |
tree | d49b0932769ba36e66bcd97e302498979efc1937 /ext/threads | |
parent | 54c0bb34295e9746f3d9fd2a6490265df2b6734c (diff) | |
download | perl-7ef93cb2ba7dd1718be26a5d315eca2414c7da42.tar.gz |
threads 1.69
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <1ff86f510802221326ib73c7e5kf26ad87086ee113d@mail.gmail.com>
p4raw-id: //depot/perl@33359
Diffstat (limited to 'ext/threads')
-rwxr-xr-x | ext/threads/Makefile.PL | 19 | ||||
-rw-r--r-- | ext/threads/t/exit.t | 22 | ||||
-rw-r--r-- | ext/threads/t/join.t | 2 | ||||
-rw-r--r-- | ext/threads/t/problems.t | 6 | ||||
-rw-r--r-- | ext/threads/t/thread.t | 13 | ||||
-rwxr-xr-x | ext/threads/threads.pm | 14 | ||||
-rwxr-xr-x | ext/threads/threads.xs | 2 |
7 files changed, 51 insertions, 27 deletions
diff --git a/ext/threads/Makefile.PL b/ext/threads/Makefile.PL index 34fdb9f957..0321738450 100755 --- a/ext/threads/Makefile.PL +++ b/ext/threads/Makefile.PL @@ -67,6 +67,7 @@ if (grep { $_ eq 'PERL_CORE=1' } @ARGV) { 'Carp' => 0, 'XSLoader' => 0, + 'Test::More' => 0, 'ExtUtils::testlib' => 0, 'Hash::Util' => 0, 'IO::File' => 0, @@ -93,4 +94,22 @@ WriteMakefile( @conditional_params ); +# Additional 'make' targets +sub MY::postamble +{ + return <<'_EXTRAS_'; +fixfiles: + @dos2unix `cat MANIFEST` + @$(CHMOD) 644 `cat MANIFEST` + @$(CHMOD) 755 examples/*.pl + +ppport: + @( cd /tmp; perl -e 'use Devel::PPPort; Devel::PPPort::WriteFile("ppport.h");' ) + @if ! cmp -s ppport.h /tmp/ppport.h; then \ + ( tkdiff ppport.h /tmp/ppport.h & ); \ + perl /tmp/ppport.h; \ + fi +_EXTRAS_ +} + # EOF diff --git a/ext/threads/t/exit.t b/ext/threads/t/exit.t index af6d2be82f..5ed204530a 100644 --- a/ext/threads/t/exit.t +++ b/ext/threads/t/exit.t @@ -6,14 +6,15 @@ BEGIN { chdir 't'; unshift @INC, '../lib'; } + + require($ENV{PERL_CORE} ? "./test.pl" : "./t/test.pl"); + use Config; if (! $Config{'useithreads'}) { - print("1..0 # Skip: Perl not compiled with 'useithreads'\n"); - exit(0); + skip_all(q/Perl not compiled with 'useithreads'/); } - - require($ENV{PERL_CORE} ? "./test.pl" : "./t/test.pl"); } + our $TODO; use ExtUtils::testlib; @@ -26,8 +27,7 @@ BEGIN { import threads::shared; }; if ($@ || ! $threads::shared::threads_shared) { - print("1..0 # Skip: threads::shared not available\n"); - exit(0); + skip_all('threads::shared not available'); } $| = 1; @@ -57,7 +57,7 @@ my $rc = $thr->join(); ok(! defined($rc), 'Exited: threads->exit()'); -run_perl(prog => 'use threads 1.67;' . +run_perl(prog => 'use threads 1.69;' . 'threads->exit(86);' . 'exit(99);', nolib => ($ENV{PERL_CORE}) ? 0 : 1, @@ -107,7 +107,7 @@ $rc = $thr->join(); ok(! defined($rc), 'Exited: $thr->set_thread_exit_only'); -run_perl(prog => 'use threads 1.67 qw(exit thread_only);' . +run_perl(prog => 'use threads 1.69 qw(exit thread_only);' . 'threads->create(sub { exit(99); })->join();' . 'exit(86);', nolib => ($ENV{PERL_CORE}) ? 0 : 1, @@ -117,7 +117,7 @@ run_perl(prog => 'use threads 1.67 qw(exit thread_only);' . is($?>>8, 86, "'use threads 'exit' => 'thread_only'"); } -my $out = run_perl(prog => 'use threads 1.67;' . +my $out = run_perl(prog => 'use threads 1.69;' . 'threads->create(sub {' . ' exit(99);' . '});' . @@ -133,7 +133,7 @@ my $out = run_perl(prog => 'use threads 1.67;' . like($out, '1 finished and unjoined', "exit(status) in thread"); -$out = run_perl(prog => 'use threads 1.67 qw(exit thread_only);' . +$out = run_perl(prog => 'use threads 1.69 qw(exit thread_only);' . 'threads->create(sub {' . ' threads->set_thread_exit_only(0);' . ' exit(99);' . @@ -150,7 +150,7 @@ $out = run_perl(prog => 'use threads 1.67 qw(exit thread_only);' . like($out, '1 finished and unjoined', "set_thread_exit_only(0)"); -run_perl(prog => 'use threads 1.67;' . +run_perl(prog => 'use threads 1.69;' . 'threads->create(sub {' . ' $SIG{__WARN__} = sub { exit(99); };' . ' die();' . diff --git a/ext/threads/t/join.t b/ext/threads/t/join.t index 64b846f22e..7c91defccb 100644 --- a/ext/threads/t/join.t +++ b/ext/threads/t/join.t @@ -57,7 +57,7 @@ sub ok { } sub skip { - ok(1, '# Skipped: ' . $_[0]); + ok(1, '# skip: ' . $_[0]); } diff --git a/ext/threads/t/problems.t b/ext/threads/t/problems.t index d979b3a512..b0eddbfa11 100644 --- a/ext/threads/t/problems.t +++ b/ext/threads/t/problems.t @@ -95,7 +95,7 @@ if ($] != 5.008) my $not = eval { Config::myconfig() } ? '' : 'not '; print "${not}ok $test - Are we able to call Config::myconfig after clone\n"; } else { - print "ok $test # Skip Are we able to call Config::myconfig after clone\n"; + print "ok $test # skip: Are we able to call Config::myconfig after clone\n"; } $test++; } @@ -123,7 +123,7 @@ threads->create(sub { print $@ =~ /disallowed/ ? '' : 'not ', "ok $test # TODO $TODO - unique_hash\n"; } else { - print("ok $test # Skip $TODO - unique_hash\n"); + print("ok $test # skip: $TODO - unique_hash\n"); } $test++; })->join; @@ -138,7 +138,7 @@ for my $decl ('my $x : unique', 'sub foo : unique') { print $@ =~ /^The 'unique' attribute may only be applied to 'our' variables/ ? '' : 'not ', "ok $test - $decl\n"; } else { - print("ok $test # Skip $decl\n"); + print("ok $test # skip: $decl\n"); } $test++; } diff --git a/ext/threads/t/thread.t b/ext/threads/t/thread.t index 7f4bd12ffa..951cab52cf 100644 --- a/ext/threads/t/thread.t +++ b/ext/threads/t/thread.t @@ -6,13 +6,13 @@ BEGIN { chdir 't'; unshift @INC, '../lib'; } + + require($ENV{PERL_CORE} ? "./test.pl" : "./t/test.pl"); + use Config; if (! $Config{'useithreads'}) { - print("1..0 # Skip: Perl not compiled with 'useithreads'\n"); - exit(0); + skip_all(q/Perl not compiled with 'useithreads'/); } - - require($ENV{PERL_CORE} ? "./test.pl" : "./t/test.pl"); } use ExtUtils::testlib; @@ -25,8 +25,7 @@ BEGIN { threads::shared->import(); }; if ($@ || ! $threads::shared::threads_shared) { - print("1..0 # Skip: threads::shared not available\n"); - exit(0); + skip_all('threads::shared not available'); } $| = 1; @@ -171,7 +170,7 @@ package main; # bugid #24165 -run_perl(prog => 'use threads 1.67;' . +run_perl(prog => 'use threads 1.69;' . 'sub a{threads->create(shift)} $t = a sub{};' . '$t->tid; $t->join; $t->tid', nolib => ($ENV{PERL_CORE}) ? 0 : 1, diff --git a/ext/threads/threads.pm b/ext/threads/threads.pm index a01abc77d8..74fd7f3766 100755 --- a/ext/threads/threads.pm +++ b/ext/threads/threads.pm @@ -5,7 +5,7 @@ use 5.008; use strict; use warnings; -our $VERSION = '1.67'; +our $VERSION = '1.69'; my $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -134,7 +134,7 @@ threads - Perl interpreter-based threads =head1 VERSION -This document describes threads version 1.67 +This document describes threads version 1.69 =head1 SYNOPSIS @@ -963,7 +963,9 @@ of the Perl interpreter. Returning objects from threads does not work. Depending on the classes involved, you may be able to work around this by returning a serialized version of the object (e.g., using L<Data::Dumper> or L<Storable>), and then -reconstituting it in the joining thread. +reconstituting it in the joining thread. If you're using Perl 5.10.0 or +later, and if the class supports L<shared objects|threads::shared/"OBJECTS">, +you can pass them via L<shared queues| Thread::Queue>. =item Perl Bugs and the CPAN Version of L<threads> @@ -978,6 +980,10 @@ with threads may result in warning messages concerning leaked scalars or unreferenced scalars. However, such warnings are harmless, and may safely be ignored. +You can search for L<threads> related bug reports at +L<http://rt.cpan.org/Public/>. If needed submit any new bugs, problems, +patches, etc. to: L<http://rt.cpan.org/Public/Dist/Display.html?Name=threads> + =back =head1 REQUIREMENTS @@ -990,7 +996,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.67/threads.pm> +L<http://annocpan.org/~JDHEDDEN/threads-1.69/threads.pm> Source repository: L<http://code.google.com/p/threads-shared/> diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs index 2b7223a00a..cb461cccbe 100755 --- a/ext/threads/threads.xs +++ b/ext/threads/threads.xs @@ -1461,7 +1461,7 @@ ithread_wantarray(...) thread = S_SV_to_ithread(aTHX_ ST(0)); ST(0) = ((thread->gimme & G_WANT) == G_ARRAY) ? &PL_sv_yes : ((thread->gimme & G_WANT) == G_VOID) ? &PL_sv_undef - /* G_SCALAR */ : &PL_sv_no; + /* G_SCALAR */ : &PL_sv_no; /* XSRETURN(1); - implied */ |