CS318 - Pintos
Pintos source browser for JHU CS318 course
|
Go to the documentation of this file.
25 for (i = 0; i < 10; i++)
33 for (i = 0; i < 10; i++)
36 msg (
"Back in main thread.");
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...
#define UNUSED
GCC lets us add "attributes" to functions, function parameters, etc.
static thread_func priority_sema_thread
Tests that the highest-priority thread waiting on a semaphore is the first to wake up.
const char * thread_name(void)
Returns the name of the running thread.
void sema_up(struct semaphore *sema)
Up or "V" operation on a semaphore.
void test_priority_sema(void)
void sema_down(struct semaphore *sema)
Down or "P" operation on a semaphore.
#define ASSERT(CONDITION)
This is outside the header guard so that debug.h may be included multiple times with different settin...
void sema_init(struct semaphore *sema, unsigned value)
This file is derived from source code for the Nachos instructional operating system.
#define PRI_MIN
Thread priorities.
void msg(const char *format,...)
bool thread_mlfqs
If false (default), use round-robin scheduler.
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_DEFAULT
Default priority.
static struct semaphore sema