From: Steve Peters Date: Tue, 14 Feb 2006 17:50:06 +0000 (+0000) Subject: Upgrade to Time-HiRes-1.87 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9b15102ac1516dec5ebb563b92cc3e6800cfa1d2;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Time-HiRes-1.87 p4raw-id: //depot/perl@27182 --- diff --git a/ext/Time/HiRes/Changes b/ext/Time/HiRes/Changes index fe9dc3e..0489123 100644 --- a/ext/Time/HiRes/Changes +++ b/ext/Time/HiRes/Changes @@ -1,5 +1,12 @@ Revision history for Perl extension Time::HiRes. +1.87 [2006-02-13] + - [rt.cpan.org #17442] 'make test' frequently fails under + Cygwin Perl v5.8.8, reported and patched by J. R. Hedden + (two race condition bugs in the END block in the case the + main process dies before the timer process, unearthed + by a bug in Cygwin ualarm) + 1.86 [2005-12-17] - HiRes.t:s/ok 32/ok 33/, from Dominic Dunlop - tighten up the clock() test marginally by requiring non-negative diff --git a/ext/Time/HiRes/HiRes.pm b/ext/Time/HiRes/HiRes.pm index 964e438..564f10e 100644 --- a/ext/Time/HiRes/HiRes.pm +++ b/ext/Time/HiRes/HiRes.pm @@ -21,7 +21,7 @@ require DynaLoader; d_nanosleep d_clock_gettime d_clock_getres d_clock d_clock_nanosleep); -$VERSION = '1.86'; +$VERSION = '1.87'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; diff --git a/ext/Time/HiRes/t/HiRes.t b/ext/Time/HiRes/t/HiRes.t index 0fed572..cae9889 100644 --- a/ext/Time/HiRes/t/HiRes.t +++ b/ext/Time/HiRes/t/HiRes.t @@ -74,11 +74,12 @@ if ($have_fork) { $timer_pid = fork(); if (defined $timer_pid) { if ($timer_pid == 0) { # We are the kid, set up the timer. + my $ppid = getppid(); print "# I am the timer process $$, sleeping for $waitfor seconds...\n"; sleep($waitfor); warn "\n$0: overall time allowed for tests (${waitfor}s) exceeded!\n"; - print "# Terminating the main process...\n"; - kill('TERM', getppid()); + print "# Terminating main process $ppid...\n"; + kill('TERM', $ppid); print "# This is the timer process $$, over and out.\n"; exit(0); } else { @@ -588,10 +589,11 @@ if ($have_clock) { } END { - if (defined $timer_pid) { + if ($timer_pid) { # Only in the main process. my $left = $TheEnd - time(); printf "# I am the main process $$, terminating the timer process $timer_pid\n# before it terminates me in %d seconds (testing took %d seconds).\n", $left, $waitfor - $left; - kill('TERM', $timer_pid); # We are done, the timer can go. + my $kill = kill('TERM', $timer_pid); # We are done, the timer can go. + printf "# kill TERM $timer_pid = %d\n", $kill; unlink("ktrace.out"); # Used in BSD system call tracing. print "# All done.\n"; }