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
-threads version 1.54
+threads version 1.56
====================
This module exposes interpreter threads to the Perl level.
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
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,
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,
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();' .
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);' .
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();' .
# 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,
use strict;
use warnings;
-our $VERSION = '1.54';
+our $VERSION = '1.56';
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
=head1 VERSION
-This document describes threads version 1.54
+This document describes threads version 1.56
=head1 SYNOPSIS
=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
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
=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>
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>