This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
threads 1.69
authorJerry D. Hedden <jdhedden@cpan.org>
Fri, 22 Feb 2008 16:26:21 +0000 (11:26 -0500)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 25 Feb 2008 06:45:05 +0000 (06:45 +0000)
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <1ff86f510802221326ib73c7e5kf26ad87086ee113d@mail.gmail.com>

p4raw-id: //depot/perl@33359

ext/threads/Makefile.PL
ext/threads/t/exit.t
ext/threads/t/join.t
ext/threads/t/problems.t
ext/threads/t/thread.t
ext/threads/threads.pm
ext/threads/threads.xs

index 34fdb9f..0321738 100755 (executable)
@@ -67,6 +67,7 @@ if (grep { $_ eq 'PERL_CORE=1' } @ARGV) {
                                     'Carp'              => 0,
                                     'XSLoader'          => 0,
 
                                     'Carp'              => 0,
                                     'XSLoader'          => 0,
 
+                                    'Test::More'        => 0,
                                     'ExtUtils::testlib' => 0,
                                     'Hash::Util'        => 0,
                                     'IO::File'          => 0,
                                     'ExtUtils::testlib' => 0,
                                     'Hash::Util'        => 0,
                                     'IO::File'          => 0,
@@ -93,4 +94,22 @@ WriteMakefile(
     @conditional_params
 );
 
     @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
 # EOF
index af6d2be..5ed2045 100644 (file)
@@ -6,14 +6,15 @@ BEGIN {
         chdir 't';
         unshift @INC, '../lib';
     }
         chdir 't';
         unshift @INC, '../lib';
     }
+
+    require($ENV{PERL_CORE} ? "./test.pl" : "./t/test.pl");
+
     use Config;
     if (! $Config{'useithreads'}) {
     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;
 our $TODO;
 
 use ExtUtils::testlib;
@@ -26,8 +27,7 @@ BEGIN {
         import threads::shared;
     };
     if ($@ || ! $threads::shared::threads_shared) {
         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;
     }
 
     $| = 1;
@@ -57,7 +57,7 @@ my $rc = $thr->join();
 ok(! defined($rc), 'Exited: threads->exit()');
 
 
 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,
                  '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');
 
 
 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,
                  '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'");
 }
 
     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);' .
                            '});' .
                            '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");
 
 
 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);' .
                         '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)");
 
 
 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();' .
                  'threads->create(sub {' .
                  '   $SIG{__WARN__} = sub { exit(99); };' .
                  '   die();' .
index 64b846f..7c91def 100644 (file)
@@ -57,7 +57,7 @@ sub ok {
 }
 
 sub skip {
 }
 
 sub skip {
-    ok(1, '# Skipped: ' . $_[0]);
+    ok(1, '# skip: ' . $_[0]);
 }
 
 
 }
 
 
index d979b3a..b0eddbf 100644 (file)
@@ -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 {
         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++;
 }
     }
     $test++;
 }
@@ -123,7 +123,7 @@ threads->create(sub {
             print $@ =~ /disallowed/
               ? '' : 'not ', "ok $test # TODO $TODO - unique_hash\n";
         } else {
             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;
         }
         $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 $@ =~ /^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++;
     }
         }
         $test++;
     }
index 7f4bd12..951cab5 100644 (file)
@@ -6,13 +6,13 @@ BEGIN {
         chdir 't';
         unshift @INC, '../lib';
     }
         chdir 't';
         unshift @INC, '../lib';
     }
+
+    require($ENV{PERL_CORE} ? "./test.pl" : "./t/test.pl");
+
     use Config;
     if (! $Config{'useithreads'}) {
     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;
 }
 
 use ExtUtils::testlib;
@@ -25,8 +25,7 @@ BEGIN {
         threads::shared->import();
     };
     if ($@ || ! $threads::shared::threads_shared) {
         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;
     }
 
     $| = 1;
@@ -171,7 +170,7 @@ package main;
 
 # bugid #24165
 
 
 # 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,
                  'sub a{threads->create(shift)} $t = a sub{};' .
                  '$t->tid; $t->join; $t->tid',
          nolib => ($ENV{PERL_CORE}) ? 0 : 1,
index a01abc7..74fd7f3 100755 (executable)
@@ -5,7 +5,7 @@ use 5.008;
 use strict;
 use warnings;
 
 use strict;
 use warnings;
 
-our $VERSION = '1.67';
+our $VERSION = '1.69';
 my $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 
 my $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 
@@ -134,7 +134,7 @@ threads - Perl interpreter-based threads
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-This document describes threads version 1.67
+This document describes threads version 1.69
 
 =head1 SYNOPSIS
 
 
 =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
 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>
 
 
 =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.
 
 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
 =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://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/>
 
 Source repository:
 L<http://code.google.com/p/threads-shared/>
index 2b7223a..cb461cc 100755 (executable)
@@ -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
         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 */
 
 
         /* XSRETURN(1); - implied */