From: Jerry D. Hedden Date: Tue, 26 Jun 2007 21:17:52 +0000 (-0400) Subject: threads 1.63 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c527c90b5f11a920b709525c63015414fa858443;p=p5sagit%2Fp5-mst-13.2.git threads 1.63 From: "Jerry D. Hedden" Message-ID: <1ff86f510706261817o52ad2e23kbd4efb16b5bed98b@mail.gmail.com> p4raw-id: //depot/perl@31477 --- diff --git a/ext/threads/Changes b/ext/threads/Changes index 86c4138..9dd628b 100755 --- a/ext/threads/Changes +++ b/ext/threads/Changes @@ -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 @@ Revision history for Perl extension threads. - 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 @@ Revision history for Perl extension threads. 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 diff --git a/ext/threads/README b/ext/threads/README index b247d99..ef29908 100755 --- a/ext/threads/README +++ b/ext/threads/README @@ -1,4 +1,4 @@ -threads version 1.62 +threads version 1.63 ==================== This module exposes interpreter threads to the Perl level. diff --git a/ext/threads/t/exit.t b/ext/threads/t/exit.t index ac147d6..a76572d 100644 --- a/ext/threads/t/exit.t +++ b/ext/threads/t/exit.t @@ -56,7 +56,7 @@ my $rc = $thr->join(); 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 @@ $rc = $thr->join(); 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 @@ run_perl(prog => 'use threads 1.62 qw(exit thread_only);' . 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 @@ is($?>>8, 99, "exit(status) in thread"); 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 @@ 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.62;' . +run_perl(prog => 'use threads 1.63;' . 'threads->create(sub {' . ' $SIG{__WARN__} = sub { exit(99); };' . ' die();' . diff --git a/ext/threads/t/thread.t b/ext/threads/t/thread.t index 6c00578..cdeccd4 100644 --- a/ext/threads/t/thread.t +++ b/ext/threads/t/thread.t @@ -171,7 +171,7 @@ package main; # 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, diff --git a/ext/threads/threads.pm b/ext/threads/threads.pm index 2f63636..8f2d1be 100755 --- a/ext/threads/threads.pm +++ b/ext/threads/threads.pm @@ -5,29 +5,25 @@ use 5.008; 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 @@ threads - Perl interpreter-based threads =head1 VERSION -This document describes threads version 1.62 +This document describes threads version 1.63 =head1 SYNOPSIS @@ -863,6 +859,12 @@ problem. =over +=item Threadsafe modules + +See L 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. For @@ -947,6 +949,11 @@ versions of Perl contain bugs that may manifest themselves despite using the latest version of L 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 Discussion Forum on CPAN: L Annotated POD for L: -L +L Source repository: L