Print a message instead of panicking upon an unexpected interrupt.
[pintos-anon] / src / tests / threads / priority-fifo.c
index 541cf5a772f997ab55c01dd60a0d11a9a2b91636..3af98a30ac217e7e7978c87ce1327771c42b10b7 100644 (file)
@@ -1,4 +1,5 @@
-/* Problem 1-3: Priority Scheduling tests.
+/* Creates several threads all at the same priority and ensures
+   that they consistently run in the same round-robin order.
 
    Based on a test originally submitted for Stanford's CS 140 in
    winter 1999 by by Matt Franklin
@@ -36,7 +37,7 @@ test_priority_fifo (void)
   int i, cnt;
 
   /* This test does not work with the MLFQS. */
-  ASSERT (!enable_mlfqs);
+  ASSERT (!thread_mlfqs);
 
   /* Make sure our priority is the default. */
   ASSERT (thread_get_priority () == PRI_DEFAULT);
@@ -49,7 +50,7 @@ test_priority_fifo (void)
   ASSERT (output != NULL);
   lock_init (&lock);
 
-  thread_set_priority (PRI_DEFAULT - 2);
+  thread_set_priority (PRI_DEFAULT + 2);
   for (i = 0; i < THREAD_CNT; i++) 
     {
       char name[16];
@@ -59,7 +60,7 @@ test_priority_fifo (void)
       d->iterations = 0;
       d->lock = &lock;
       d->op = &op;
-      thread_create (name, PRI_DEFAULT - 1, simple_thread_func, d);
+      thread_create (name, PRI_DEFAULT + 1, simple_thread_func, d);
     }
 
   thread_set_priority (PRI_DEFAULT);