Change 14097 by jhi@alpha on 2002/01/05 22:11:35

        Retract #14057 for now; the alarm/setitimer timers
        seen to be the same in many systems, which leads into
        hangups.

Affected files ...

.... //depot/perl/ext/Time/HiRes/HiRes.t#21 edit

Differences ...

==== //depot/perl/ext/Time/HiRes/HiRes.t#21 (text) ====
Index: perl/ext/Time/HiRes/HiRes.t
--- perl/ext/Time/HiRes/HiRes.t.~1~     Sat Jan  5 15:15:12 2002
+++ perl/ext/Time/HiRes/HiRes.t Sat Jan  5 15:15:12 2002
@@ -128,24 +128,14 @@
     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);
 }
End of Patch.

Reply via email to