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

regina::NThread Class Reference
[General Utility Classes]

Provides very basic thread handling. More...

#include <nthread.h>

Inheritance diagram for regina::NThread:

regina::NFacePairing List of all members.

Public Member Functions

virtual ~NThread ()
 Destroys this thread.
bool start (void *args=0, bool deleteAfterwards=false)
 Starts a new thread that performs the run() routine.
virtual void * run (void *args)=0
 The routine to run in the new thread when start(void*) is called.

Static Public Member Functions

bool start (void *(*routine)(void *), void *args, NThreadID *id)
 Starts a new thread that performs the given routine.
void yield ()
 Causes the currently running thread to voluntarily relinquish the processor.

Detailed Description

Provides very basic thread handling.

Each subclass of NThread represents a specific task that new threads should perform.

A subclass should override run() so that it performs whatever task is required of each new thread. Then start() may be called whenever a new thread is required.

Python:
Not present.


Constructor & Destructor Documentation

regina::NThread::~NThread  )  [inline, virtual]
 

Destroys this thread.


Member Function Documentation

virtual void* regina::NThread::run void *  args  )  [pure virtual]
 

The routine to run in the new thread when start(void*) is called.

Parameters:
args the argument passed to start(void*).
Returns:
the return value is currently ignored.

Implemented in regina::NFacePairing.

bool regina::NThread::start void *(*)(void *)  routine,
void *  args,
NThreadID id
[static]
 

Starts a new thread that performs the given routine.

The return value of the given routine is currently ignored.

Parameters:
routine the routine to run in the new thread.
args the arguments to pass to routine when it is started.
id a location in which the ID of the new thread will be placed, or 0 if the new thread ID is not required. If non-zero, this parameter must point to an already extisting NThreadID that may contain any value.
Returns:
true if and only if the new thread was successfully started.

bool regina::NThread::start void *  args = 0,
bool  deleteAfterwards = false
 

Starts a new thread that performs the run() routine.

The return value of run() is currently ignored.

Parameters:
args the arguments to pass to run() when it is started.
deleteAfterwards true if this NThread object should be deleted once run() has finished.
Returns:
true if and only if the new thread was successfully started.

void regina::NThread::yield  )  [inline, static]
 

Causes the currently running thread to voluntarily relinquish the processor.

Another thread of equal or higher priority will be given a turn instead.


The documentation for this class was generated from the following file:
Copyright © 1999-2004, Ben Burton
This software is released under the GNU General Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).