Add explanatory comments to threads tests.
[pintos-anon] / src / tests / threads / alarm-priority.c
index 379f49213b136f1f7d53f87ddf176a17ea3ac37e..51ca6a92f1146c248cfc538f7fac44871919598c 100644 (file)
@@ -1,3 +1,6 @@
+/* Checks that when the alarm clock wakes up threads, the
+   higher-priority threads run first. */
+
 #include <stdio.h>
 #include "tests/threads/tests.h"
 #include "threads/init.h"
@@ -39,7 +42,7 @@ static void
 alarm_priority_thread (void *aux UNUSED) 
 {
   /* Busy-wait until the current time changes. */
-  int64_t start_time;
+  int64_t start_time = timer_ticks ();
   while (timer_elapsed (start_time) == 0)
     continue;