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

PosixThread Class Reference

#include <thread.h>

Inheritance diagram for PosixThread:

Thread List of all members.

Public Member Functions

 CCXX_MEMBER_EXPORT (CCXX_EMPTY) PosixThread(int pri=0
void signalThread (int signo)
 Delivers a Posix signal to the current thread.


Public Attributes

size_t stack = 0)

Protected Member Functions

void signalParent (signo_t signo)
 In the Posix version of Common C++, this can be used to send a signal into the parent thread of the current object.

void signalMain (signo_t signo)
 In the Posix version of Common C++, this can be used to send a signal into the main application thread.

virtual void onTimer (void)
 A derivable method to call when a SIGALRM is being delivered to a specific thread.

virtual void onHangup (void)
 A derived method to handle hangup events being delivered to a specific thread.

virtual void onException (void)
 A derived method to call when a SIGABRT is being delivered to a specific thread.

virtual void onDisconnect (void)
 A derived method to call when a SIGPIPE is being delivered to a specific thread.

virtual void onPolling (void)
 A derived method to handle asynchronous I/O requests delivered to the specified thread.

virtual void onSignal (int)
 A derivable method to call for delivering a signal event to a specified thread.

void setTimer (timeout_t timer, bool periodic=false)
 Used to specify a timeout event that can be delivered to the current thread via SIGALRM.

timeout_t getTimer (void) const
 Gets the time remaining for the current threads timer before it expires.

void endTimer (void)
 Terminates the timer before the timeout period has expired.

void waitSignal (signo_t signo)
 Used to wait on a Posix signal from another thread.

void setSignal (int signo, bool active)
 Used to enable or disable a signal within the current thread.


Friends

class ThreadImpl
class Thread
void sigInstall (int signo)
 Install a signal handler for use by threads and the OnSignal() event notification handler.


Member Function Documentation

PosixThread::CCXX_MEMBER_EXPORT CCXX_EMPTY   )  [pure virtual]
 

void PosixThread::endTimer void   )  [protected]
 

Terminates the timer before the timeout period has expired.

This prevents the timer from sending it's SIGALRM and makes the timer available to other threads.

timeout_t PosixThread::getTimer void   )  const [protected]
 

Gets the time remaining for the current threads timer before it expires.

Returns:
time remaining before timer expires in milliseconds.

virtual void PosixThread::onDisconnect void   )  [inline, protected, virtual]
 

A derived method to call when a SIGPIPE is being delivered to a specific thread.

virtual void PosixThread::onException void   )  [inline, protected, virtual]
 

A derived method to call when a SIGABRT is being delivered to a specific thread.

virtual void PosixThread::onHangup void   )  [inline, protected, virtual]
 

A derived method to handle hangup events being delivered to a specific thread.

virtual void PosixThread::onPolling void   )  [inline, protected, virtual]
 

A derived method to handle asynchronous I/O requests delivered to the specified thread.

virtual void PosixThread::onSignal int   )  [inline, protected, virtual]
 

A derivable method to call for delivering a signal event to a specified thread.

Parameters:
- posix signal id.

virtual void PosixThread::onTimer void   )  [inline, protected, virtual]
 

A derivable method to call when a SIGALRM is being delivered to a specific thread.

void PosixThread::setSignal int  signo,
bool  active
[protected]
 

Used to enable or disable a signal within the current thread.

Parameters:
signo posix signal id.
active set to true to enable.

void PosixThread::setTimer timeout_t  timer,
bool  periodic = false
[protected]
 

Used to specify a timeout event that can be delivered to the current thread via SIGALRM.

When the timer expires, the onTimer() method is called for the thread. At present, only one thread timer can be active at any given time. On some operating systems (including Linux) a timer can be active on each thread.

Parameters:
timer timeout in milliseconds.
periodic should the timer be periodic.
Note:
currently, periodic timers are only available on systems with a working setitimer call.

void PosixThread::signalMain signo_t  signo  )  [inline, protected]
 

In the Posix version of Common C++, this can be used to send a signal into the main application thread.

Parameters:
signo a posix signal id.

void PosixThread::signalParent signo_t  signo  )  [inline, protected]
 

In the Posix version of Common C++, this can be used to send a signal into the parent thread of the current object.

Parameters:
signo a posix signal id.

void PosixThread::signalThread int  signo  )  [inline]
 

Delivers a Posix signal to the current thread.

Parameters:
signo a posix signal id.

void PosixThread::waitSignal signo_t  signo  )  [protected]
 

Used to wait on a Posix signal from another thread.

This can be used as a crude rondevious/synchronization method between threads.

Parameters:
signo a posix signal id.


Friends And Related Function Documentation

void sigInstall int  signo  )  [friend]
 

Install a signal handler for use by threads and the OnSignal() event notification handler.

Parameters:
signo posix signal id.

friend class Thread [friend]
 

friend class ThreadImpl [friend]
 

Reimplemented from Thread.


Member Data Documentation

size_t PosixThread::stack = 0)
 


The documentation for this class was generated from the following file:
Generated on Thu Sep 25 13:14:32 2003 for GNU CommonC++ by doxygen 1.3.3