Thread * current_thread
Currently running thread.
Definition: tasking.c:23
int num_threads
The number of threads in this process.
Definition: tasking.h:34
struct Thread * prev_thread_in_process
The previous thread in the process.
Definition: tasking.h:50
thread_state state
The state of this thread. (running,ready to run,blocked,etc.)
Definition: tasking.h:47
int * tasking_get_errno_address()
Definition: tasking.c:136
void tasking_yield()
Definition: tasking.c:206
int num_threads_blocked
The number of blocked threads in this process.
Definition: tasking.h:35
thread_state
Definition: tasking.h:16
pid_t tasking_new_thread(void *start, pid_t pid, void *param)
Definition: tasking.c:140
@ THREAD_BLOCKED
The state of a generically blocked thread.
Definition: tasking.h:20
@ THREAD_RUNNING
The state of a running thread.
Definition: tasking.h:17
struct Thread * next_thread_in_process
The next thread in the process.
Definition: tasking.h:49
Process * process
The thread's process.
Definition: tasking.h:53
pid_t next_tid
The TID that the next created thread will use.
Definition: tasking.h:33
char tasking_is_privleged()
Definition: tasking.c:128
pid_t tid
The TID of this thread.
Definition: tasking.h:46
void tasking_unblock(pid_t pid, pid_t tid)
Definition: tasking.c:292
pid_t tasking_get_PID()
Definition: tasking.c:132
void tasking_exit(int code)
Definition: tasking.c:306
@ THREAD_EXITED
The state of an exited thread.
Definition: tasking.h:19
char priv
Whether the process is privileged (can execute syscalls to acesss all of memory/has acess to IO ports...
Definition: tasking.h:31
void * kernel_esp
The thread's kernel stack.
Definition: tasking.h:43
struct Thread * first_thread
A pointer to the head of the linked list of threads for this process.
Definition: tasking.h:36
void tasking_create_task(void *eip, void *address_space, char kmode, void *param1, void *param2, char isThread)
Definition: tasking.c:87
void tasking_block(thread_state newstate)
Definition: tasking.c:233
pid_t pid
The PID of this process.
Definition: tasking.h:32
struct Thread * next_ready_to_run
If the thread is in the ready to run list, this is the next ready to run thread. (potentially in a di...
Definition: tasking.h:51
int errno
The errno value for this thread.
Definition: tasking.h:48
void tasking_init()
Definition: tasking.c:120
void * kernel_esp_top
The top of the thread's kernel stack.
Definition: tasking.h:44
struct Thread * prev_ready_to_run
If the thread is in the ready to run list, this is the previous ready to run thread....
Definition: tasking.h:52
void * address_space
The address space of this thread. (it is in here and not in the process to simplify the task switch a...
Definition: tasking.h:45
@ THREAD_READY
The state of a ready to run thread.
Definition: tasking.h:18