From: Jerry D. Hedden Date: Fri, 22 Feb 2008 16:26:21 +0000 (-0500) Subject: threads 1.69 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7ef93cb2ba7dd1718be26a5d315eca2414c7da42;p=p5sagit%2Fp5-mst-13.2.git threads 1.69 From: "Jerry D. Hedden" Message-ID: <1ff86f510802221326ib73c7e5kf26ad87086ee113d@mail.gmail.com> p4raw-id: //depot/perl@33359 --- diff --git a/ext/threads/Makefile.PL b/ext/threads/Makefile.PL index 34fdb9f..0321738 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 af6d2be..5ed2045 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 64b846f..7c91def 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 d979b3a..b0eddbf 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 7f4bd12..951cab5 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 a01abc7..74fd7f3 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 or L), 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, +you can pass them via L. =item Perl Bugs and the CPAN Version of L @@ -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 related bug reports at +L. If needed submit any new bugs, problems, +patches, etc. to: L + =back =head1 REQUIREMENTS @@ -990,7 +996,7 @@ L Discussion Forum on CPAN: L Annotated POD for L: -L +L Source repository: L diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs index 2b7223a..cb461cc 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 */