Invert the priority scheme, so that PRI_MIN is now the lowest priority
[pintos-anon] / src / tests / threads / priority-sema.c
index 8ca17a0aa9c3991f0b7b14b38e4b9f60051067e7..d7eb9cc076cfbaf26f9a174ff1503dcdb24d6d1a 100644 (file)
@@ -21,10 +21,10 @@ test_priority_sema (void)
   ASSERT (!enable_mlfqs);
 
   sema_init (&sema, 0);
-  thread_set_priority (PRI_MAX);
+  thread_set_priority (PRI_MIN);
   for (i = 0; i < 10; i++) 
     {
-      int priority = (i + 3) % 10 + PRI_DEFAULT + 1;
+      int priority = PRI_DEFAULT - (i + 3) % 10 - 1;
       char name[16];
       snprintf (name, sizeof name, "priority %d", priority);
       thread_create (name, priority, priority_sema_thread, NULL);