CS318 - Pintos
Pintos source browser for JHU CS318 course
|
Go to the documentation of this file. 1 #ifndef THREADS_THREAD_H
2 #define THREADS_THREAD_H
20 #define TID_ERROR ((tid_t) -1)
24 #define PRI_DEFAULT 31
uint8_t * stack
Saved stack pointer.
void thread_start(void)
Starts preemptive thread scheduling by enabling interrupts.
Not running but ready to run.
thread_status
States in a thread's life cycle.
A kernel thread or user process.
tid_t tid
Thread identifier.
void thread_yield(void)
Yields the CPU.
int thread_get_load_avg(void)
threads/thread.h
void thread_action_func(struct thread *t, void *aux)
Performs some operation on thread t, given auxiliary data AUX.
struct list_elem allelem
List element for all threads list.
int tid_t
Thread identifier type.
enum thread_status status
Thread state.
struct list_elem elem
List element.
unsigned magic
Detects stack overflow.
bool thread_mlfqs
If false (default), use round-robin scheduler.
int thread_get_nice(void)
Returns the current thread's nice value.
const char * thread_name(void)
Returns the name of the running thread.
void thread_exit(void) NO_RETURN
Deschedules the current thread and destroys it.
struct thread * thread_current(void)
Returns the running thread.
void thread_block(void)
Puts the current thread to sleep.
void thread_print_stats(void)
Prints thread statistics.
Waiting for an event to trigger.
char name[16]
Name (for debugging purposes).
void thread_unblock(struct thread *)
Transitions a blocked thread T to the ready-to-run state.
void thread_foreach(thread_action_func *, void *)
Invoke function 'func' on all threads, passing along 'aux'.
int thread_get_priority(void)
Returns the current thread's priority.
tid_t thread_tid(void)
Returns the running thread's tid.
int thread_get_recent_cpu(void)
Returns 100 times the current thread's recent_cpu value.
void thread_func(void *aux)
tid_t thread_create(const char *name, int priority, thread_func *, void *)
Creates a new kernel thread named NAME with the given initial PRIORITY, which executes FUNCTION passi...
void thread_set_priority(int)
Sets the current thread's priority to NEW_PRIORITY.
void thread_tick(void)
Called by the timer interrupt handler at each timer tick.
void thread_set_nice(int)