46 msg (
"Main thread finished.");
55 msg (
"Thread L acquired lock.");
57 msg (
"Thread L downed semaphore.");
59 msg (
"Thread L finished.");
68 msg (
"Thread M finished.");
77 msg (
"Thread H acquired lock.");
81 msg (
"Thread H finished.");
#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_sema(void)
static thread_func m_thread_func
static thread_func h_thread_func
static thread_func l_thread_func
Low priority thread L acquires a lock, then blocks downing a semaphore.
void lock_release(struct lock *lock)
Releases LOCK, which must be owned by the current thread.
void sema_init(struct semaphore *sema, unsigned value)
This file is derived from source code for the Nachos instructional operating system.
void sema_up(struct semaphore *sema)
Up or "V" operation on a semaphore.
void lock_init(struct lock *lock)
Initializes LOCK.
void lock_acquire(struct lock *lock)
Acquires LOCK, sleeping until it becomes available if necessary.
void sema_down(struct semaphore *sema)
Down or "P" operation on a semaphore.
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)