2 #include "tests/threads/tests.h"
3 #include "threads/init.h"
4 #include "threads/thread.h"
6 static thread_func changing_thread;
9 test_priority_change (void)
11 /* This test does not work with the MLFQS. */
12 ASSERT (!enable_mlfqs);
14 msg ("Creating a high-priority thread 2.");
15 thread_create ("thread 2", PRI_DEFAULT - 1, changing_thread, NULL);
16 msg ("Thread 2 should have just lowered its priority.");
17 thread_set_priority (PRI_DEFAULT + 2);
18 msg ("Thread 2 should have just exited.");
22 changing_thread (void *aux UNUSED)
24 msg ("Thread 2 now lowering priority.");
25 thread_set_priority (PRI_DEFAULT + 1);
26 msg ("Thread 2 exiting.");