Change 31477 by [EMAIL PROTECTED] on 2007/06/27 09:59:11
Subject: [PATCH-revised] threads 1.63
From: "Jerry D. Hedden" <[EMAIL PROTECTED]>
Date: Tue, 26 Jun 2007 21:17:52 -0400
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/ext/threads/Changes#38 edit
... //depot/perl/ext/threads/README#36 edit
... //depot/perl/ext/threads/t/exit.t#17 edit
... //depot/perl/ext/threads/t/thread.t#42 edit
... //depot/perl/ext/threads/threads.pm#88 edit
Differences ...
==== //depot/perl/ext/threads/Changes#38 (xtext) ====
Index: perl/ext/threads/Changes
--- perl/ext/threads/Changes#37~31238~ 2007-05-18 15:48:12.000000000 -0700
+++ perl/ext/threads/Changes 2007-06-27 02:59:11.000000000 -0700
@@ -1,5 +1,12 @@
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
@@ -10,7 +17,7 @@
- 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
@@ -21,10 +28,10 @@
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
==== //depot/perl/ext/threads/README#36 (xtext) ====
Index: perl/ext/threads/README
--- perl/ext/threads/README#35~31238~ 2007-05-18 15:48:12.000000000 -0700
+++ perl/ext/threads/README 2007-06-27 02:59:11.000000000 -0700
@@ -1,4 +1,4 @@
-threads version 1.62
+threads version 1.63
====================
This module exposes interpreter threads to the Perl level.
==== //depot/perl/ext/threads/t/exit.t#17 (text) ====
Index: perl/ext/threads/t/exit.t
--- perl/ext/threads/t/exit.t#16~31238~ 2007-05-18 15:48:12.000000000 -0700
+++ perl/ext/threads/t/exit.t 2007-06-27 02:59:11.000000000 -0700
@@ -56,7 +56,7 @@
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,
@@ -104,7 +104,7 @@
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,
@@ -112,7 +112,7 @@
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);' .
'});' .
@@ -125,7 +125,7 @@
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);' .
@@ -139,7 +139,7 @@
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();' .
==== //depot/perl/ext/threads/t/thread.t#42 (text) ====
Index: perl/ext/threads/t/thread.t
--- perl/ext/threads/t/thread.t#41~31238~ 2007-05-18 15:48:12.000000000
-0700
+++ perl/ext/threads/t/thread.t 2007-06-27 02:59:11.000000000 -0700
@@ -171,7 +171,7 @@
# 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,
==== //depot/perl/ext/threads/threads.pm#88 (xtext) ====
Index: perl/ext/threads/threads.pm
--- perl/ext/threads/threads.pm#87~31238~ 2007-05-18 15:48:12.000000000
-0700
+++ perl/ext/threads/threads.pm 2007-06-27 02:59:11.000000000 -0700
@@ -5,29 +5,25 @@
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;
@@ -138,7 +134,7 @@
=head1 VERSION
-This document describes threads version 1.62
+This document describes threads version 1.63
=head1 SYNOPSIS
@@ -863,6 +859,12 @@
=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
@@ -947,6 +949,11 @@
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
@@ -959,7 +966,7 @@
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/>
End of Patch.