Revision history for Perl extension threads.
+1.63 Tue Jun 26 21:15:27 EDT 2007
+ - Avoid double-free of the thread function
+ - Added reference in POD to perlmod section on thread safety
+ - Mention leaked and unreferenced scalar warnings in POD
+ - Removed BEGIN in threads.pm
+ - Only need to require Config
+
1.62 Thu May 17 16:10:49 2007
- Fixed :all import option
- Fixed problems in test suite
- Upgraded ppport.h to Devel::PPPort 3.11
- Removed embed.t - unreliable
-1.59 - Mon Feb 5 16:05:44 EST 2007
+1.59 Mon Feb 5 16:05:44 EST 2007
- POD tweaks per Wolfgang Laun
1.58 Wed Jan 24 13:15:34 EST 2007
1.57 Wed Dec 20 13:10:26 EST 2006
- Fixes courtesy of Michael J. Pomraning
- Eliminates self joins.
- Eliminates multiple, simultaneous joins on a thread.
- Protects thread->state variable with mutexes.
- Checks that OS join call is successful.
+ Eliminates self joins
+ Eliminates multiple, simultaneous joins on a thread
+ Protects thread->state variable with mutexes
+ Checks that OS join call is successful
1.56 Fri Dec 15 12:18:47 EST 2006
- More fixes to test suite
-threads version 1.62
+threads version 1.63
====================
This module exposes interpreter threads to the Perl level.
ok(! defined($rc), 'Exited: threads->exit()');
-run_perl(prog => 'use threads 1.62;' .
+run_perl(prog => 'use threads 1.63;' .
'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.62 qw(exit thread_only);' .
+run_perl(prog => 'use threads 1.63 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.62;' .
+my $out = run_perl(prog => 'use threads 1.63;' .
'threads->create(sub {' .
' exit(99);' .
'});' .
like($out, '1 finished and unjoined', "exit(status) in thread");
-$out = run_perl(prog => 'use threads 1.62 qw(exit thread_only);' .
+$out = run_perl(prog => 'use threads 1.63 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.62;' .
+run_perl(prog => 'use threads 1.63;' .
'threads->create(sub {' .
' $SIG{__WARN__} = sub { exit(99); };' .
' die();' .
# bugid #24165
-run_perl(prog => 'use threads 1.62;' .
+run_perl(prog => 'use threads 1.63;' .
'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.62';
+our $VERSION = '1.63';
my $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
+# Verify this Perl supports threads
+require Config;
+if (! $Config::Config{useithreads}) {
+ die("This Perl not built to support threads\n");
+}
-BEGIN {
- # Verify this Perl supports threads
- use Config;
- if (! $Config{useithreads}) {
- die("This Perl not built to support threads\n");
- }
-
- # Complain if 'threads' is loaded after 'threads::shared'
- if ($threads::shared::threads_shared) {
- warn <<'_MSG_';
+# Complain if 'threads' is loaded after 'threads::shared'
+if ($threads::shared::threads_shared) {
+ warn <<'_MSG_';
Warning, threads::shared has already been loaded. To
enable shared variables, 'use threads' must be called
before threads::shared or any module that uses it.
_MSG_
- }
}
-
# Declare that we have been loaded
$threads::threads = 1;
=head1 VERSION
-This document describes threads version 1.62
+This document describes threads version 1.63
=head1 SYNOPSIS
=over
+=item Threadsafe modules
+
+See L<perlmod/"Making your module threadsafe"> when creating modules that may
+be used in threaded applications, especially if those modules use non-Perl
+data, or XS code.
+
=item Using non-threadsafe modules
Unfortunately, you may encounter Perl modules that are not I<threadsafe>. For
latest version of L<threads> from CPAN. There is no workaround for this other
than upgrading to the lastest version of Perl.
+Even with the lastest version of Perl, it is known that certain constructs
+with threads may result in warning messages concerning leaked scalars or
+unreferenced scalars. However, such warnings are harmless, and may safely be
+ignored.
+
=back
=head1 REQUIREMENTS
L<http://www.cpanforum.com/dist/threads>
Annotated POD for L<threads>:
-L<http://annocpan.org/~JDHEDDEN/threads-1.62/threads.pm>
+L<http://annocpan.org/~JDHEDDEN/threads-1.63/threads.pm>
Source repository:
L<http://code.google.com/p/threads-shared/>