Thread Class Reference

List of all members.

Public Types

enum  { HIGH = 1, NORMAL = 15, LOW = 63, IDLE = 127 }
enum  ThreadState {
  RUNNING, READY, SUSPENDED, FINISHING,
  DESTROYED
}
enum  ThreadType { JOINABLE, DETACHED }
typedef short State
typedef short Priority

Public Member Functions

 Thread (int(*entry)(), const State &state=READY, const Priority &priority=NORMAL, unsigned int stack_size=STACK_SIZE)
template<class T1 >
 Thread (int(*entry)(T1 a1), T1 a1, const State &state=READY, const Priority &priority=NORMAL, unsigned int stack_size=STACK_SIZE)
template<class T1 , class T2 >
 Thread (int(*entry)(T1 a1, T2 a2), T1 a1, T2 a2, const State &state=READY, const Priority &priority=NORMAL, unsigned int stack_size=STACK_SIZE)
template<class T1 , class T2 , class T3 >
 Thread (int(*entry)(T1 a1, T2 a2, T3 a3), T1 a1, T2 a2, T3 a3, const State &state=READY, const Priority &priority=NORMAL, unsigned int stack_size=STACK_SIZE)
volatile const State & state () const
volatile const Priority & priority () const
void priority (const Priority &priority)
int join ()
void pass ()
void suspend ()
void resume ()
void addSemaphore (Semaphore *semaphore)
void removeSemaphore (Semaphore *semaphore)

Static Public Member Functions

static void yield ()
static void exit (int status=0)
static Thread *volatile running ()
static int init (System_Info *si)
static void idle ()

Private Types

typedef Queue< ThreadQueue
typedef CPU::Log_Addr Log_Addr
typedef CPU::Context Context

Private Member Functions

void header (Log_Addr entry, unsigned int stack_size)
void body ()
void releaseSemaphores ()

Static Private Member Functions

static void implicit_exit ()

Private Attributes

Log_Addr _stack
Context *volatile _context
volatile State _state
volatile Priority _priority
Queue::Element _link
CircularVector< Semaphore * > _semaphores
Thread_waitingThread

Static Private Attributes

static const Type_Id TYPE = Type<Thread>::TYPE
static const unsigned int STACK_SIZE

Friends

class Scheduler


Detailed Description

object that is accessible to user-level
Author:
Group 06

Definition at line 26 of file thread.h.


Constructor & Destructor Documentation

Thread::Thread ( int(*)()  entry,
const State &  state = READY,
const Priority &  priority = NORMAL,
unsigned int  stack_size = STACK_SIZE 
) [inline]

The int left on the stack between thread's arguments and its context is due to the fact that the thread's function believes it's a normal function that will be invoked with a call, which pushes the return address on the stack

Definition at line 70 of file thread.h.


Member Data Documentation

Circular Vector of Semaphore

Definition at line 212 of file thread.h.

const unsigned int Thread::STACK_SIZE [static, private]

Initial value:

                __SYS(Traits)<Machine>::APPLICATION_STACK_SIZE

Definition at line 33 of file thread.h.


The documentation for this class was generated from the following files:

Generated on Mon May 4 09:42:22 2009 for EPOS-- by  doxygen 1.5.8