threads 1.56
authorJerry D. Hedden <jdhedden@cpan.org>
Fri, 15 Dec 2006 09:22:17 +0000 (01:22 -0800)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sat, 16 Dec 2006 10:03:23 +0000 (10:03 +0000)
From: "Jerry D. Hedden" <jdhedden@yahoo.com>
Message-ID: <20061215172217.10959.qmail@web30211.mail.mud.yahoo.com>

p4raw-id: //depot/perl@29563

ext/threads/Changes
ext/threads/README
ext/threads/t/err.t
ext/threads/t/exit.t
ext/threads/t/thread.t
ext/threads/threads.pm

index 698f337..643155f 100755 (executable)
@@ -1,5 +1,11 @@
 Revision history for Perl extension threads.
 
+1.56 Fri Dec 15 12:18:47 EST 2006
+       - More fixes to test suite
+
+1.55 Fri Dec 15 11:24:46 EST 2006
+       - Fixes to test suite
+
 1.54 Thu Dec 14 14:12:30 EST 2006
        - Added ->error() method
 
index 3803a26..ae21582 100755 (executable)
@@ -1,4 +1,4 @@
-threads version 1.54
+threads version 1.56
 ====================
 
 This module exposes interpreter threads to the Perl level.
index a0df7a5..9911187 100644 (file)
@@ -26,14 +26,14 @@ use_ok('threads');
 no warnings 'threads';
 
 # Create a thread that generates an error
-my $thr = threads->create(sub { my $x = 5/0; });
+my $thr = threads->create(sub { my $x = Foo->new(); });
 
 # Check that thread returns 'undef'
 my $result = $thr->join();
 ok(! defined($result), 'thread died');
 
 # Check error
-like($thr->error(), 'division by zero', 'thread error');
+like($thr->error(), q/Can't locate object method/, 'thread error');
 
 
 # Create a thread that 'die's with an object
index 25fba99..a23d394 100644 (file)
@@ -56,7 +56,7 @@ my $rc = $thr->join();
 ok(! defined($rc), 'Exited: threads->exit()');
 
 
-run_perl(prog => 'use threads 1.54;' .
+run_perl(prog => 'use threads 1.56;' .
                  'threads->exit(86);' .
                  'exit(99);',
          nolib => ($ENV{PERL_CORE}) ? 0 : 1,
@@ -104,7 +104,7 @@ $rc = $thr->join();
 ok(! defined($rc), 'Exited: $thr->set_thread_exit_only');
 
 
-run_perl(prog => 'use threads 1.54 qw(exit thread_only);' .
+run_perl(prog => 'use threads 1.56 qw(exit thread_only);' .
                  'threads->create(sub { exit(99); })->join();' .
                  'exit(86);',
          nolib => ($ENV{PERL_CORE}) ? 0 : 1,
@@ -112,7 +112,7 @@ run_perl(prog => 'use threads 1.54 qw(exit thread_only);' .
 is($?>>8, 86, "'use threads 'exit' => 'thread_only'");
 
 
-my $out = run_perl(prog => 'use threads 1.54;' .
+my $out = run_perl(prog => 'use threads 1.56;' .
                            'threads->create(sub {' .
                            '    exit(99);' .
                            '})->join();' .
@@ -124,7 +124,7 @@ is($?>>8, 99, "exit(status) in thread");
 like($out, '1 finished and unjoined', "exit(status) in thread");
 
 
-$out = run_perl(prog => 'use threads 1.54 qw(exit thread_only);' .
+$out = run_perl(prog => 'use threads 1.56 qw(exit thread_only);' .
                         'threads->create(sub {' .
                         '   threads->set_thread_exit_only(0);' .
                         '   exit(99);' .
@@ -137,7 +137,7 @@ is($?>>8, 99, "set_thread_exit_only(0)");
 like($out, '1 finished and unjoined', "set_thread_exit_only(0)");
 
 
-run_perl(prog => 'use threads 1.54;' .
+run_perl(prog => 'use threads 1.56;' .
                  'threads->create(sub {' .
                  '   $SIG{__WARN__} = sub { exit(99); };' .
                  '   die();' .
index cf3a232..3d3989e 100644 (file)
@@ -171,7 +171,7 @@ package main;
 
 # bugid #24165
 
-run_perl(prog => 'use threads 1.54;' .
+run_perl(prog => 'use threads 1.56;' .
                  'sub a{threads->create(shift)} $t = a sub{};' .
                  '$t->tid; $t->join; $t->tid',
          nolib => ($ENV{PERL_CORE}) ? 0 : 1,
index a718dcf..eff472f 100755 (executable)
@@ -5,7 +5,7 @@ use 5.008;
 use strict;
 use warnings;
 
-our $VERSION = '1.54';
+our $VERSION = '1.56';
 my $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 
@@ -133,7 +133,7 @@ threads - Perl interpreter-based threads
 
 =head1 VERSION
 
-This document describes threads version 1.54
+This document describes threads version 1.56
 
 =head1 SYNOPSIS
 
@@ -845,7 +845,11 @@ specified signal being used in a C<-E<gt>kill()> call.
 
 =back
 
-=head1 LIMITATIONS
+=head1 BUGS AND LIMITATIONS
+
+Before you consider posting a bug report, please consult, and possibly post a
+message to the discussion forum to see if what you've encountered is a known
+problem.
 
 =over
 
@@ -876,16 +880,6 @@ threads are started afterwards.
 If the above does not work, or is not adequate for your application, then file
 a bug report on L<http://rt.cpan.org/Public/> against the problematic module.
 
-=back
-
-=head1 BUGS
-
-Before you consider posting a bug report, please consult, and possibly post a
-message to the discussion forum to see if what you've encountered is a known
-problem.
-
-=over
-
 =item Parent-child threads
 
 On some platforms, it might not be possible to destroy I<parent> threads while
@@ -930,7 +924,10 @@ of the Perl interpreter.
 
 =item Returning objects from threads
 
-Returning objects from threads does not work.
+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.
 
 =item Perl Bugs and the CPAN Version of L<threads>
 
@@ -952,7 +949,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.54/threads.pm>
+L<http://annocpan.org/~JDHEDDEN/threads-1.56/threads.pm>
 
 L<threads::shared>, L<perlthrtut>