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 processprocess
 
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.
 

Detailed Description

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.

Field Documentation

◆ context

thread_context_t thread::context

This includes registers, and information that must be kept for when switching back into the thread.

◆ flags

u32 thread::flags

Combination of thread_flags values

◆ proc_this

node_t thread::proc_this

Linked list used by the process to list threads

◆ process

struct process* thread::process

Containing process

◆ state

thread_state_t thread::state

Thread's current state, used by the scheduler

◆ this

node_t thread::this

Intrusive linked list used by the scheduler

◆ tid

pid_t thread::tid

Thread ID

◆ wakeup

clock_t thread::wakeup

Time when it should wakeup (in ticks)


The documentation for this struct was generated from the following file: