X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Ftests%2Fthreads%2Fpriority-condvar.c;h=3e31081da6a9b673c2d0a933189e46cb0205e990;hb=e373cd64cfe799b3cb148e1117f3b3184b5a6457;hp=0d34380ca7739772df3f22a6710f91076ab59ff6;hpb=4ebf33908a571a7cde93fe618902b044e3633cdf;p=pintos-anon diff --git a/src/tests/threads/priority-condvar.c b/src/tests/threads/priority-condvar.c index 0d34380..3e31081 100644 --- a/src/tests/threads/priority-condvar.c +++ b/src/tests/threads/priority-condvar.c @@ -1,3 +1,6 @@ +/* Tests that cond_signal() wakes up the highest-priority thread + waiting in cond_wait(). */ + #include #include "tests/threads/tests.h" #include "threads/init.h" @@ -21,10 +24,10 @@ test_priority_condvar (void) lock_init (&lock); cond_init (&condition); - thread_set_priority (PRI_MAX); + thread_set_priority (PRI_MIN); for (i = 0; i < 10; i++) { - int priority = (i + 7) % 10 + PRI_DEFAULT + 1; + int priority = PRI_DEFAULT - (i + 7) % 10 - 1; char name[16]; snprintf (name, sizeof name, "priority %d", priority); thread_create (name, priority, priority_condvar_thread, NULL);