35 msg (
"This thread should have priority %d. Actual priority: %d.",
38 msg (
"This thread should have priority %d. Actual priority: %d.",
41 msg (
"acquire2, acquire1 must already have finished, in that order.");
42 msg (
"This should be the last line before finishing this test.");
51 msg (
"acquire1: got the lock");
53 msg (
"acquire1: done");
62 msg (
"acquire2: got the lock");
64 msg (
"acquire2: done");
#define ASSERT(CONDITION)
This is outside the header guard so that debug.h may be included multiple times with different settin...
void msg(const char *format,...)
void test_priority_donate_one(void)
static thread_func acquire1_thread_func
The main thread acquires a lock.
static thread_func acquire2_thread_func
void lock_release(struct lock *lock)
Releases LOCK, which must be owned by the current thread.
void lock_init(struct lock *lock)
Initializes LOCK.
void lock_acquire(struct lock *lock)
Acquires LOCK, sleeping until it becomes available if necessary.
bool thread_mlfqs
If false (default), use round-robin scheduler.
int thread_get_priority(void)
Returns the current thread's priority.
tid_t thread_create(const char *name, int priority, thread_func *function, void *aux)
Creates a new kernel thread named NAME with the given initial PRIORITY, which executes FUNCTION passi...
#define PRI_DEFAULT
Default priority.
void thread_func(void *aux)