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)
}
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";
}
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")) {
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 {
skip 24;
skip 25;
}
+
+if (defined $pid) {
+ print "# Terminating the timer process $pid\n";
+ kill('TERM', $pid); # We are done, the timer can go.
+}
+