head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.37; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.51; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.53.59; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.55; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# SGThread Class Reference

Encapsulate generic threading methods. More...

`#include <SGThread.hxx>`

List of all members.

## Public Types
enum | cancel_t { CANCEL_DISABLE = 0, CANCEL_DEFERRED, CANCEL_IMMEDIATE }
| SGThread cancelation modes.
## Public Methods
| SGThread ()
| Create a new thread object.
int | start ()
| Start the underlying thread of execution.
void | cancel ()
| Sends a cancellation request to the underlying thread.
void | join ()
| Suspends the exection of the calling thread until this thread terminates.
## Protected Methods
virtual | ~SGThread ()
| Destroy a thread object.
void | set_cancel (cancel_t mode)
| Set the threads cancellation mode.
virtual void | run ()=0
| All threads execute by deriving the run() method of SGThread.
## Friends
void * | start_handler (void *)

## Detailed Description

Encapsulate generic threading methods.

Users derive a class from SGThread and implement the run() member function.

Definition at line 47 of file SGThread.hxx.

## Constructor & Destructor Documentation

SGThread::SGThread | ( |  | ) | `[inline]`

| Create a new thread object. When a SGThread object is created it does not begin execution immediately. It is started by calling the start() member function. Definition at line 123 of file SGThread.hxx.

SGThread::~SGThread | ( |  | ) | `[inline, protected, virtual]`

| Destroy a thread object. This is protected so that its illegal to simply delete a thread it must return from its run() function. Definition at line 128 of file SGThread.hxx.

## Member Function Documentation

void SGThread::cancel | ( |  | ) | `[inline]`

| Sends a cancellation request to the underlying thread. The target thread will either ignore the request, honor it immediately or defer it until it reaches a cancellation point. Definition at line 148 of file SGThread.hxx.

virtual void SGThread::run | ( |  | ) | `[protected, pure virtual]`

| All threads execute by deriving the run() method of SGThread. If this function terminates then the thread also terminates.

void SGThread::set_cancel | ( | cancel_t | mode | ) | `[protected]`

  | Set the threads cancellation mode. Parameters:
  mode | The required cancellation mode.
Definition at line 20 of file SGThread.cxx.

int SGThread::start | ( |  | ) | `[inline]`

| Start the underlying thread of execution. Returns: Pthread error code if execution fails, otherwise returns 0. Definition at line 133 of file SGThread.hxx.

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

- SGThread.hxx
- SGThread.cxx

@ 1.3 log @Oops, try again. @ text @d254 1 a254 1