From 8a40154ad529f4c3d15068b3b3103197fb896add Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 5 Oct 2006 03:07:31 +0000 Subject: [PATCH] Sleep until recent_cpu actually decays. --- src/tests/threads/mlfqs-recent-1.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tests/threads/mlfqs-recent-1.c b/src/tests/threads/mlfqs-recent-1.c index 670b00c..4258671 100644 --- a/src/tests/threads/mlfqs-recent-1.c +++ b/src/tests/threads/mlfqs-recent-1.c @@ -114,10 +114,14 @@ test_mlfqs_recent_1 (void) ASSERT (thread_mlfqs); - msg ("Sleeping 10 seconds to allow recent_cpu to decay, please wait..."); - start_time = timer_ticks (); - timer_sleep (DIV_ROUND_UP (start_time, TIMER_FREQ) - start_time - + 10 * TIMER_FREQ); + do + { + msg ("Sleeping 10 seconds to allow recent_cpu to decay, please wait..."); + start_time = timer_ticks (); + timer_sleep (DIV_ROUND_UP (start_time, TIMER_FREQ) - start_time + + 10 * TIMER_FREQ); + } + while (thread_get_recent_cpu () > 700); start_time = timer_ticks (); for (;;) -- 2.30.2