summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-10-28 08:48:06 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-10-28 08:48:06 +0000
commit690f7c5f9e0ee073c67e83215cf3b54948d9b440 (patch)
tree45e04c3c5223565074e8caee46ed78e93ed35586 /ext
parent61f33854a9297ada503a0aaeb7eed1072b0de126 (diff)
downloadperl-690f7c5f9e0ee073c67e83215cf3b54948d9b440.tar.gz
Upgrade to Time::HiRes 1.52.
p4raw-id: //depot/perl@21567
Diffstat (limited to 'ext')
-rw-r--r--ext/Time/HiRes/Changes5
-rw-r--r--ext/Time/HiRes/HiRes.pm2
-rw-r--r--ext/Time/HiRes/Makefile.PL2
-rw-r--r--ext/Time/HiRes/t/HiRes.t33
4 files changed, 39 insertions, 3 deletions
diff --git a/ext/Time/HiRes/Changes b/ext/Time/HiRes/Changes
index 7c5ae8ea93..c2bce390a2 100644
--- a/ext/Time/HiRes/Changes
+++ b/ext/Time/HiRes/Changes
@@ -1,5 +1,10 @@
Revision history for Perl extension Time::HiRes.
+1.52
+ - In AIX (v?) with perl 5.6.1 the HiRes.t can hang after
+ the subtest 18. No known analysis nor fix, but added
+ an alarm (that requires fork() and alarm()) to the test.
+
1.51
- doc tweaks from mjd (perl change #20456)
- NCR MP-RAS hints file added (svr4.pl) (perl change #21249)
diff --git a/ext/Time/HiRes/HiRes.pm b/ext/Time/HiRes/HiRes.pm
index 546e381151..d04b1a895b 100644
--- a/ext/Time/HiRes/HiRes.pm
+++ b/ext/Time/HiRes/HiRes.pm
@@ -15,7 +15,7 @@ require DynaLoader;
d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer
d_nanosleep);
-$VERSION = '1.51';
+$VERSION = '1.52';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
diff --git a/ext/Time/HiRes/Makefile.PL b/ext/Time/HiRes/Makefile.PL
index 04485c76f9..fc6a155224 100644
--- a/ext/Time/HiRes/Makefile.PL
+++ b/ext/Time/HiRes/Makefile.PL
@@ -284,7 +284,7 @@ EOD
}
if ($has_setitimer && $has_getitimer) {
- print "You have interval timers (both setitimer and getitimer).\n";
+ print "You have interval timers (both setitimer and setitimer).\n";
} else {
print "You do not have interval timers.\n";
}
diff --git a/ext/Time/HiRes/t/HiRes.t b/ext/Time/HiRes/t/HiRes.t
index 3afefbe1da..5e4128ee0c 100644
--- a/ext/Time/HiRes/t/HiRes.t
+++ b/ext/Time/HiRes/t/HiRes.t
@@ -30,6 +30,31 @@ import Time::HiRes 'ualarm' if $have_ualarm;
use Config;
+my $have_alarm = $Config{d_alarm};
+my $have_fork = $Config{d_fork};
+my $waitfor = 60; # 10 seconds is normal.
+my $pid;
+
+if ($have_fork) {
+ print "# Testing process $$\n";
+ print "# Starting the timer process\n";
+ if (defined ($pid = fork())) {
+ if ($pid == 0) { # We are the kid, set up the timer.
+ print "# Timer process $$\n";
+ sleep($waitfor);
+ warn "$0: Time's up!\n";
+ print "# Terminating the testing process\n";
+ kill('TERM', getppid());
+ print "# Timer process exiting\n";
+ exit(0);
+ }
+ } else {
+ warn "$0: fork failed: $!\n";
+ }
+} else {
+ print "# No timer process\n";
+}
+
my $xdefine = '';
if (open(XDEFINE, "xdefine")) {
@@ -131,7 +156,7 @@ else {
ok 11, $f > 0.4 && $f < 0.9, "slept $f instead of 0.5 secs.";
}
-if (!$have_ualarm || !$Config{d_alarm}) {
+if (!$have_ualarm || !$have_alarm) {
skip 12..13;
}
else {
@@ -337,3 +362,9 @@ if ($have_ualarm) {
skip 24;
skip 25;
}
+
+if (defined $pid) {
+ print "# Terminating the timer process $pid\n";
+ kill('TERM', $pid); # We are done, the timer can go.
+}
+