|
My Kernel v0.1.0
|
A single thread. More...
#include <process.h>
Data Fields | |
| thread_context_t | context |
| Arch specific thread context. More... | |
| thread_state_t | state |
| struct process * | process |
| node_t | proc_this |
| struct interrupt_frame | frame |
| Frame pushed during the last userland -> kernel context switch. | |
| pid_t | tid |
| u32 | flags |
| node_t | this |
| union { | |
| struct { | |
| clock_t preempt | |
| End of the currently running thread's timeslice. | |
| } running | |
| For running threads only. | |
| struct { | |
| clock_t wakeup | |
| } sleep | |
| For sleeping threads only. | |
| }; | |
| Information relative to the current state of the thread. | |
The struct contains information about the thread's execution state. This state is architecture dependant, so its actual definition is present inside the arch specific process header file.
Generic information about a thread include its current state (used by the scheduler), information about its containing process and feature flags.
| thread_context_t thread::context |
This includes registers, and information that must be kept for when switching back into the thread.
| u32 thread::flags |
Combination of thread_flags values
| node_t thread::proc_this |
Linked list used by the process to list threads
| struct process* thread::process |
Containing process
| thread_state_t thread::state |
Thread's current state, used by the scheduler
| node_t thread::this |
Intrusive linked list used by the scheduler
| pid_t thread::tid |
Thread ID
| clock_t thread::wakeup |
Time when it should wakeup (in ticks)