From: Steve Peters Date: Tue, 3 Oct 2006 13:28:30 +0000 (+0000) Subject: Upgrade to threads-1.42 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=45cd5be73bf5c2ad46a82c3a4df3760035464110;p=p5sagit%2Fp5-mst-13.2.git Upgrade to threads-1.42 p4raw-id: //depot/perl@28922 --- diff --git a/ext/threads/Changes b/ext/threads/Changes index f4acc64..51e796a 100755 --- a/ext/threads/Changes +++ b/ext/threads/Changes @@ -1,5 +1,9 @@ Revision history for Perl extension threads. +1.42 Mon Sep 18 11:17:13 EDT 2006 + - Fixes to tests + - Move $threads::threads outside of BEGIN block + 1.41 Fri Sep 8 19:28:41 EST 2006 - Race condition fixes diff --git a/ext/threads/README b/ext/threads/README index 79c0b4b..b1aca16 100755 --- a/ext/threads/README +++ b/ext/threads/README @@ -1,4 +1,4 @@ -threads version 1.41 +threads version 1.42 ==================== This module exposes interpreter threads to the Perl level. diff --git a/ext/threads/t/libc.t b/ext/threads/t/libc.t index 2c24bad..4935775 100644 --- a/ext/threads/t/libc.t +++ b/ext/threads/t/libc.t @@ -60,12 +60,6 @@ for (0..$i) { my $mutex = 2; share($mutex); -sub localtime_r { - lock($mutex); - my $retval = localtime(shift()); - return $retval; -} - my @threads; for (0..$i) { my $thread = threads->create(sub { @@ -74,13 +68,17 @@ for (0..$i) { my $error = 0; for (0..$y) { my $lt = localtime($arg); - if($localtime ne $lt) { + if ($localtime ne $lt) { $error++; } } lock($mutex); + while ($mutex != ($_ + 2)) { + cond_wait($mutex); + } ok($mutex, ! $error, 'localtime safe'); $mutex++; + cond_broadcast($mutex); }); push @threads, $thread; } diff --git a/ext/threads/t/thread.t b/ext/threads/t/thread.t index c583cbc..ef68444 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.41;' . +run_perl(prog => 'use threads 1.42;' . '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 630d9a2..7574487 100755 --- a/ext/threads/threads.pm +++ b/ext/threads/threads.pm @@ -5,7 +5,7 @@ use 5.008; use strict; use warnings; -our $VERSION = '1.41'; +our $VERSION = '1.42'; my $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -17,9 +17,6 @@ BEGIN { die("This Perl not built to support threads\n"); } - # Declare that we have been loaded - $threads::threads = 1; - # Complain if 'threads' is loaded after 'threads::shared' if ($threads::shared::threads_shared) { warn <<'_MSG_'; @@ -31,6 +28,9 @@ _MSG_ } +# Declare that we have been loaded +$threads::threads = 1; + # Load the XS code require XSLoader; XSLoader::load('threads', $XS_VERSION); @@ -129,7 +129,7 @@ threads - Perl interpreter-based threads =head1 VERSION -This document describes threads version 1.41 +This document describes threads version 1.42 =head1 SYNOPSIS @@ -886,7 +886,7 @@ L Discussion Forum on CPAN: L Annotated POD for L: -L +L L, L