X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ftests%2Fthreads%2Fmlfqs-recent-1.c;h=425867145c79b2e54f892e51d8f0da33473cf53a;hb=c00f7a66b5c2352cddc3db336731bab3a8faa1ba;hp=c217f837f4e3f573429b9d1870c1d4c2fb992e6b;hpb=0d095b17daaed97df1943ac031058b428ad3f5fa;p=pintos-anon diff --git a/src/tests/threads/mlfqs-recent-1.c b/src/tests/threads/mlfqs-recent-1.c index c217f83..4258671 100644 --- a/src/tests/threads/mlfqs-recent-1.c +++ b/src/tests/threads/mlfqs-recent-1.c @@ -112,12 +112,16 @@ test_mlfqs_recent_1 (void) int64_t start_time; int last_elapsed = 0; - ASSERT (enable_mlfqs); + 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 (;;)