From: Ben Pfaff Date: Wed, 6 Jul 2005 20:45:36 +0000 (+0000) Subject: Eliminate race condition in timer_print_stats() found by Sorav's X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7891eee6ec6f5db5dc0ab0a3b4790936bfffaabb;p=pintos-anon Eliminate race condition in timer_print_stats() found by Sorav's Checkbochs tool. --- diff --git a/src/devices/timer.c b/src/devices/timer.c index 24eede0..c8c41d5 100644 --- a/src/devices/timer.c +++ b/src/devices/timer.c @@ -123,7 +123,7 @@ timer_nsleep (int64_t ns) void timer_print_stats (void) { - printf ("Timer: %"PRId64" ticks\n", ticks); + printf ("Timer: %"PRId64" ticks\n", timer_ticks ()); } /* Timer interrupt handler. */