|
| PosixThread (int pri=0, size_t stack=0) |
|
void | signalThread (int signo) |
| Delivers a Posix signal to the current thread.
|
|
| Thread (bool isMain) |
| This is actually a special constructor that is used to create a thread "object" for the current execution context when that context is not created via an instance of a derived Thread object itself.
|
|
| Thread (int pri=0, size_t stack=0) |
| When a thread object is contructed, a new thread of execution context is created.
|
|
| Thread (const Thread &th) |
| A thread of execution can also be specified by cloning an existing thread.
|
|
virtual | ~Thread () |
| The thread destructor should clear up any resources that have been allocated by the thread.
|
|
int | start (Semaphore *start=0) |
| When a new thread is created, it does not begin immediate execution.
|
|
int | detach (Semaphore *start=0) |
| Start a new thread as "detached".
|
|
Thread * | getParent (void) |
| Gets the pointer to the Thread class which created the current thread object.
|
|
void | suspend (void) |
| Suspends execution of the selected thread.
|
|
void | resume (void) |
| Resumes execution of the selected thread.
|
|
Cancel | getCancel (void) |
| Used to retrieve the cancellation mode in effect for the selected thread.
|
|
bool | isRunning (void) const |
| Verifies if the thread is still running or has already been terminated but not yet deleted.
|
|
bool | isDetached (void) const |
| Check if this thread is detached.
|
|
void | join (void) |
| Blocking call which unlocks when thread terminates.
|
|
bool | isThread (void) const |
| Tests to see if the current execution context is the same as the specified thread object.
|
|
cctid_t | getId (void) const |
| Get system thread numeric identifier.
|
|
const char * | getName (void) const |
| Get the name string for this thread, to use in debug messages.
|
|
|
static void | sigInstall (int signo) |
| Install a signal handler for use by threads and the OnSignal() event notification handler.
|
|
static Thread * | get (void) |
|
static void | setStack (size_t size=0) |
| Set base stack limit before manual stack sizes have effect.
|
|
static void | sleep (timeout_t msec) |
| A thread-safe sleep call.
|
|
static void | yield (void) |
| Yields the current thread's CPU time slice to allow another thread to begin immediate execution.
|
|
static Throw | getException (void) |
| Get exception mode of the current thread.
|
|
static void | setException (Throw mode) |
| Set exception mode of the current thread.
|
|
static Cancel | enterCancel (void) |
| This is used to help build wrapper functions in libraries around system calls that should behave as cancellation points but don't.
|
|
static void | exitCancel (Cancel cancel) |
| This is used to restore a cancel block.
|
|
|
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 | setSignal (int signo, bool active) |
| Used to enable or disable a signal within the current thread.
|
|
pthread_attr_t * | getPthreadAttrPtr (void) |
| Access to pthread_attr structure this allows setting/modifying pthread attributes not covered in the platform independant Thread constructor, e.g.
|
|
pthread_t | getPthreadId (void) |
| Get pthread_t of underlying posix thread (useful for debugging/logging)
|
|
void | setName (const char *text) |
| Set the name of the current thread.
|
|
virtual void | run (void)=0 |
| All threads execute by deriving the Run method of Thread.
|
|
virtual void | final (void) |
| A thread that is self terminating, either by invoking exit() or leaving it's run(), will have this method called.
|
|
virtual void | initial (void) |
| The initial method is called by a newly created thread when it starts execution.
|
|
virtual void * | getExtended (void) |
| Since getParent() and getThread() only refer to an object of the Thread "base" type, this virtual method can be replaced in a derived class with something that returns data specific to the derived class that can still be accessed through the pointer returned by getParent() and getThread().
|
|
virtual void | notify (Thread *) |
| When a thread terminates, it now sends a notification message to the parent thread which created it.
|
|
void | exit (void) |
| Used to properly exit from a Thread derived run() or initial() method.
|
|
void | sync (void) |
| Used to wait for a join or cancel, in place of explicit exit.
|
|
bool | testCancel (void) |
| test a cancellation point for deferred thread cancellation.
|
|
void | setCancel (Cancel mode) |
| Sets thread cancellation mode.
|
|
void | setSuspend (Suspend mode) |
| Sets the thread's ability to be suspended from execution.
|
|
void | terminate (void) |
| Used by another thread to terminate the current thread.
|
|
void | clrParent (void) |
| clear parent thread relationship.
|
|