Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Examples

P::Thread Class Reference
[Core library]

Thread base class. More...

#include <pthread_.h>

List of all members.

Public Types

enum  state_t { Stopped, Running, Suspended }
 Thread state. More...


Public Member Functions

 Thread () throw ()
virtual ~Thread ()
void start (Semaphore *sem=0, int prio=0) throw (LogicError, ThreadError)
 Start thread.

bool stop (unsigned int timeout) throw (LogicError, SyncError)
 Stop thread.

void kill () throw (LogicError, SystemError)
 Kill the thread.

bool suspend (unsigned int timeout) throw (LogicError, SyncError)
 Suspend threads execution.

void resume () throw (LogicError, SyncError)
 Resume threads execution.

state_t state () const throw ()
 Returns the state of the thread.


Static Public Member Functions

void yield () throw ()
 Give up calling threads CPU time.

void sleep (unsigned int timeout) throw ()
 Delay execution of calling thread.

void exit () throw ()
 Terminate calling thread.

Threadcurrent () throw ()
 Returns a pointer to the current thread.


Protected Member Functions

virtual bool initial ()=0
virtual void main ()=0
virtual void suspended ()
virtual void resumed ()
virtual void final ()
bool testCancel () throw (LogicError, SyncError)
thread_handle_t * handle () const throw ()

Static Protected Member Functions

thread_handle_t * createHandle ()
void destroyHandle (thread_handle_t *handle)

Friends

class Private
struct thread_handle_t


Detailed Description

Thread base class.

Todo:
Thread::setPriority()
Author:
Christian Prochnow <cproch@seculogix.de>

Definition at line 50 of file pthread_.h.


Member Enumeration Documentation

enum P::Thread::state_t
 

Thread state.

Enumeration values:
Stopped  Thread is in stopped state
Running  Thread is in running state
Suspended  Thread is in suspended state

Definition at line 53 of file pthread_.h.


Constructor & Destructor Documentation

P::Thread::Thread  )  throw ()
 

virtual P::Thread::~Thread  )  [virtual]
 


Member Function Documentation

thread_handle_t* P::Thread::createHandle  )  [static, protected]
 

Thread* P::Thread::current  )  throw () [static]
 

Returns a pointer to the current thread.

void P::Thread::destroyHandle thread_handle_t *  handle  )  [static, protected]
 

void P::Thread::exit  )  throw () [static]
 

Terminate calling thread.

virtual void P::Thread::final  )  [inline, protected, virtual]
 

Definition at line 103 of file pthread_.h.

thread_handle_t* P::Thread::handle  )  const throw () [protected]
 

virtual bool P::Thread::initial  )  [protected, pure virtual]
 

void P::Thread::kill  )  throw (LogicError, SystemError)
 

Kill the thread.

virtual void P::Thread::main  )  [protected, pure virtual]
 

void P::Thread::resume  )  throw (LogicError, SyncError)
 

Resume threads execution.

virtual void P::Thread::resumed  )  [inline, protected, virtual]
 

Definition at line 102 of file pthread_.h.

void P::Thread::sleep unsigned int  timeout  )  throw () [static]
 

Delay execution of calling thread.

Delays the execution of the calling thread by the given amount of milliseconds.

Parameters:
timeout amount of milliseconds how long the thread should be suspended.

void P::Thread::start Semaphore sem = 0,
int  prio = 0
throw (LogicError, ThreadError)
 

Start thread.

state_t P::Thread::state  )  const throw ()
 

Returns the state of the thread.

bool P::Thread::stop unsigned int  timeout  )  throw (LogicError, SyncError)
 

Stop thread.

bool P::Thread::suspend unsigned int  timeout  )  throw (LogicError, SyncError)
 

Suspend threads execution.

virtual void P::Thread::suspended  )  [inline, protected, virtual]
 

Definition at line 101 of file pthread_.h.

bool P::Thread::testCancel  )  throw (LogicError, SyncError) [protected]
 

void P::Thread::yield  )  throw () [static]
 

Give up calling threads CPU time.


Friends And Related Function Documentation

friend class Private [friend]
 

Definition at line 108 of file pthread_.h.

friend struct thread_handle_t [friend]
 

Definition at line 111 of file pthread_.h.


The documentation for this class was generated from the following file:
Generated on Fri Mar 12 21:08:37 2004 for P::Classes by doxygen 1.3.3