<gmh@leland.stanford.edu>, Yu Ping Hu <yph@cs.stanford.edu>.
Modified by arens. */
-#ifdef MLFQS
-#error This test not applicable with MLFQS enabled.
-#endif
-
#include "threads/test.h"
#include <stdio.h>
#include "threads/synch.h"
void
test (void)
{
+ /* This test does not work with the MLFQS. */
+ ASSERT (!enable_mlfqs);
+
/* Make sure our priority is the default. */
ASSERT (thread_get_priority () == PRI_DEFAULT);
lock_init (&lock, "donor");
lock_acquire (&lock);
thread_create ("acquire1", PRI_DEFAULT + 1, acquire1_thread_func, &lock);
- printf ("1. This thread should have priority %d. Actual priority: %d.\n",
+ printf ("This thread should have priority %d. Actual priority: %d.\n",
PRI_DEFAULT + 1, thread_get_priority ());
thread_create ("acquire2", PRI_DEFAULT + 2, acquire2_thread_func, &lock);
- printf ("2. This thread should have priority %d. Actual priority: %d.\n",
+ printf ("This thread should have priority %d. Actual priority: %d.\n",
PRI_DEFAULT + 2, thread_get_priority ());
lock_release (&lock);
- printf ("7. acquire2, acquire1 must already have finished, in that order.\n"
- "8. This should be the last line before finishing this test.\n"
+ printf ("acquire2, acquire1 must already have finished, in that order.\n"
+ "This should be the last line before finishing this test.\n"
"Priority donation test done.\n");
}
struct lock *lock = lock_;
lock_acquire (lock);
- printf ("5. acquire1: got the lock\n");
+ printf ("acquire1: got the lock\n");
lock_release (lock);
- printf ("6. acquire1: done\n");
+ printf ("acquire1: done\n");
}
static void
struct lock *lock = lock_;
lock_acquire (lock);
- printf ("3. acquire2: got the lock\n");
+ printf ("acquire2: got the lock\n");
lock_release (lock);
- printf ("4. acquire2: done\n");
+ printf ("acquire2: done\n");
}