thread Struct Reference
[generic]


Public Member Functions

 SPINLOCK_DECLARE (lock)

Data Fields

link_t rq_link
link_t wq_link
link_t th_link
char name [THREAD_NAME_BUFLEN]
void(* thread_code )(void *)
void * thread_arg
context_t saved_context
context_t sleep_timeout_context
context_t sleep_interruption_context
bool sleep_interruptible
waitq_tsleep_queue
timeout_t sleep_timeout
volatile int timeout_pending
bool in_copy_from_uspace
bool in_copy_to_uspace
bool interrupted
thread_join_type_t join_type
bool detached
waitq_t join_wq
fpu_context_tsaved_fpu_context
int fpu_context_exists
int fpu_context_engaged
rwlock_type_t rwlock_holder_type
void(* call_me )(void *)
void * call_me_with
state_t state
int flags
cpu_tcpu
task_ttask
__u64 ticks
int priority
__u32 tid
thread_arch_t arch
__u8kstack

Detailed Description

Thread structure. There is one per thread.

Definition at line 81 of file thread.h.


Member Function Documentation

SPINLOCK_DECLARE lock   ) 
 

Lock protecting thread structure.

Protects the whole thread structure except list links above.


Field Documentation

thread_arch_t arch
 

Architecture-specific data.

Definition at line 150 of file thread.h.

void(* call_me)(void *)
 

Funtion to be called in scheduler before the thread is put asleep.

Referenced by thread_create().

void* call_me_with
 

Argument passed to call_me().

Definition at line 137 of file thread.h.

Referenced by thread_create().

cpu_t* cpu
 

Thread's CPU.

Definition at line 142 of file thread.h.

Referenced by kinit(), thread_create(), thread_destroy(), and thread_ready().

bool detached
 

If true, thread_join_timeout() cannot be used on this thread.

Definition at line 121 of file thread.h.

Referenced by thread_create(), thread_detach(), and thread_join_timeout().

int flags
 

Thread's flags.

Definition at line 140 of file thread.h.

Referenced by kcpulb(), kinit(), thread_create(), and thread_ready().

int fpu_context_engaged
 

Definition at line 132 of file thread.h.

Referenced by kcpulb(), and thread_create().

int fpu_context_exists
 

Definition at line 125 of file thread.h.

Referenced by thread_create().

bool in_copy_from_uspace
 

True if this thread is executing copy_from_uspace(). False otherwise.

Definition at line 110 of file thread.h.

Referenced by thread_create().

bool in_copy_to_uspace
 

True if this thread is executing copy_to_uspace(). False otherwise.

Definition at line 112 of file thread.h.

Referenced by thread_create().

bool interrupted
 

If true, the thread will not go to sleep at all and will call thread_exit() before returning to userspace.

Definition at line 118 of file thread.h.

Referenced by task_kill(), and thread_create().

thread_join_type_t join_type
 

Who joinins the thread.

Definition at line 120 of file thread.h.

Referenced by ktaskclnp(), ktaskgc(), and thread_create().

waitq_t join_wq
 

Waitq for thread_join_timeout().

Definition at line 122 of file thread.h.

Referenced by thread_create(), and thread_join_timeout().

__u8* kstack
 

Thread's kernel stack.

Definition at line 152 of file thread.h.

Referenced by thr_constructor(), thr_destructor(), and thread_create().

char name[THREAD_NAME_BUFLEN]
 

Definition at line 92 of file thread.h.

Referenced by thread_create().

int priority
 

Thread's priority. Implemented as index to CPU->rq

Definition at line 147 of file thread.h.

Referenced by thread_create(), and thread_ready().

link_t rq_link
 

Run queue link.

Definition at line 82 of file thread.h.

Referenced by kcpulb(), thr_constructor(), and thread_ready().

rwlock_type_t rwlock_holder_type
 

Definition at line 134 of file thread.h.

Referenced by let_others_in(), and thread_create().

context_t saved_context
 

From here, the stored context is restored when the thread is scheduled.

Definition at line 98 of file thread.h.

Referenced by thread_create(), waitq_interrupt_sleep(), and waitq_timeouted_sleep().

fpu_context_t* saved_fpu_context
 

Definition at line 124 of file thread.h.

Referenced by thr_constructor(), and thr_destructor().

bool sleep_interruptible
 

If true, the thread can be interrupted from sleep.

Definition at line 104 of file thread.h.

Referenced by thread_create(), and waitq_interrupt_sleep().

context_t sleep_interruption_context
 

From here, the stored interruption context is restored when sleep is interrupted.

Definition at line 102 of file thread.h.

Referenced by waitq_interrupt_sleep().

waitq_t* sleep_queue
 

Wait queue in which this thread sleeps.

Definition at line 105 of file thread.h.

Referenced by _waitq_wakeup_unsafe(), thread_create(), waitq_interrupt_sleep(), and waitq_timeouted_sleep().

timeout_t sleep_timeout
 

Timeout used for timeoutable sleeping.

Definition at line 106 of file thread.h.

Referenced by _waitq_wakeup_unsafe(), thread_create(), and waitq_interrupt_sleep().

context_t sleep_timeout_context
 

From here, the stored timeout context is restored when sleep times out.

Definition at line 100 of file thread.h.

Referenced by waitq_timeouted_sleep().

state_t state
 

Thread's state.

Definition at line 139 of file thread.h.

Referenced by kcpulb(), ktaskgc(), sched_print_list(), task_kill(), thread_create(), thread_destroy(), thread_detach(), and thread_ready().

task_t* task
 

Containing task.

Definition at line 143 of file thread.h.

Referenced by thread_create(), and thread_destroy().

link_t th_link
 

Links to threads within containing task.

Definition at line 84 of file thread.h.

Referenced by thr_constructor(), and thread_create().

void* thread_arg
 

Argument passed to thread_code() function.

Definition at line 95 of file thread.h.

Referenced by thread_create().

void(* thread_code)(void *)
 

Function implementing the thread.

Referenced by thread_create().

__u64 ticks
 

Ticks before preemption.

Definition at line 145 of file thread.h.

Referenced by thread_create().

__u32 tid
 

Thread ID.

Definition at line 148 of file thread.h.

Referenced by kcpulb(), sched_print_list(), sys_thread_create(), and thread_create().

volatile int timeout_pending
 

Flag signalling sleep timeout in progress.

Definition at line 107 of file thread.h.

Referenced by _waitq_wakeup_unsafe(), thread_create(), waitq_interrupt_sleep(), and waitq_timeouted_sleep().

link_t wq_link
 

Wait queue link.

Definition at line 83 of file thread.h.

Referenced by _waitq_wakeup_unsafe(), thr_constructor(), waitq_interrupt_sleep(), and waitq_timeouted_sleep().


Generated on Sun Jun 18 17:20:42 2006 for HelenOS Kernel (ppc32) by  doxygen 1.4.6