diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-05 22:11:35 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-05 22:11:35 +0000 |
commit | 9715e8511d7ded5c50f7cf8ce067dea8b9c2c2d1 (patch) | |
tree | feee23278494c7ade7d650bcad2af8063a183b1c /ext | |
parent | 9e55ce066d52428ee12b0c4df544c9a64f88c082 (diff) | |
download | perl-9715e8511d7ded5c50f7cf8ce067dea8b9c2c2d1.tar.gz |
Retract #14057 for now; the alarm/setitimer timers
seen to be the same in many systems, which leads into
hangups.
p4raw-id: //depot/perl@14097
Diffstat (limited to 'ext')
-rw-r--r-- | ext/Time/HiRes/HiRes.t | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/ext/Time/HiRes/HiRes.t b/ext/Time/HiRes/HiRes.t index c09eaa7453..e246d82f62 100644 --- a/ext/Time/HiRes/HiRes.t +++ b/ext/Time/HiRes/HiRes.t @@ -128,24 +128,14 @@ else { my $tick = 0; local $SIG{ALRM} = sub { $tick++ }; - # This was previously written sleep 3 until $tick; - # But there is a small race condition here: the alarm may go off - # until ($tick) { Here!; sleep } - # In which case the sleep is forever. - # sleeping for 3 seconds will cause the test to fail but it's better than - # infinite hang. [Until someone produces a platform where sleep interferes - # with ualarm, in which case a more sophisticated self destruct will need - # to be written (eg fork, child sleeps for a long time, child kills parent - # if parent doesn't finish first (killing child))] - - my $one = time; $tick = 0; ualarm(10_000); sleep 3 until $tick; - my $two = time; $tick = 0; ualarm(10_000); sleep 3 until $tick; + my $one = time; $tick = 0; ualarm(10_000); sleep until $tick; + my $two = time; $tick = 0; ualarm(10_000); sleep until $tick; my $three = time; ok 12, $one == $two || $two == $three, "slept too long, $one $two $three"; $tick = 0; ualarm(10_000, 10_000); - sleep 3 until $tick >= 3; + sleep until $tick >= 3; ok 13, 1; ualarm(0); } |