33#define NESTING_DEPTH 8
68 thread_priority =
PRI_MIN + i * 3;
73 msg (
"%s should have priority %d. Actual priority: %d.",
97 msg (
"%s should have priority %d. Actual priority: %d",
#define ASSERT(CONDITION)
This is outside the header guard so that debug.h may be included multiple times with different settin...
#define UNUSED
GCC lets us add "attributes" to functions, function parameters, etc.
int snprintf(char *buffer, size_t buf_size, const char *format,...)
Like printf(), except that output is stored into BUFFER, which must have space for BUF_SIZE character...
void msg(const char *format,...)
#define NESTING_DEPTH
The main thread set its priority to PRI_MIN and creates 7 threads (thread 1..7) with priorities PRI_M...
static thread_func donor_thread_func
static thread_func interloper_thread_func
void test_priority_donate_chain(void)
Low-priority main thread L acquires lock A.
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.
const char * thread_name(void)
Returns the name of the running thread.
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...
void thread_set_priority(int new_priority)
Sets the current thread's priority to NEW_PRIORITY.
void thread_func(void *aux)
#define PRI_MIN
Thread priorities.