From: Jarkko Hietaniemi Date: Sat, 5 Jan 2002 22:11:35 +0000 (+0000) Subject: Retract #14057 for now; the alarm/setitimer timers X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9715e8511d7ded5c50f7cf8ce067dea8b9c2c2d1;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/ext/Time/HiRes/HiRes.t b/ext/Time/HiRes/HiRes.t index c09eaa7..e246d82 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); }