Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

GAUGE3D::GThread Class Reference

Multithreading support. More...

#include <gauge3d/osabstraction/thread.h>

Inherits GAUGE3D::GObject.

List of all members.

Public Methods

 GThread (void *(*start)(void *))
 Create the thread, but don't start it yet. More...

 ~GThread ()
 Kill and destroy the thread.

void Start (void *arg)
 Start the thread with the given argument. More...

void* Join ()
 Wait for the thread to finish and get the return value. More...

void Detach ()
 Call if you will not be joining the thread. More...


Static Public Methods

void Return (void *retVal)
 Quit the current thread. More...


Detailed Description

Multithreading support.

This class allows for multitasking support.


Constructor & Destructor Documentation

GAUGE3D::GThread::GThread ( void *(* start)(void *) )
 

Create the thread, but don't start it yet.

Parameters:
start   A pointer to the function to run from the new thread. The function takes one parameter of type void* and returns void*.


Member Function Documentation

void GAUGE3D::GThread::Start ( void * arg )
 

Start the thread with the given argument.

Parameters:
arg   The argument to pass to the thread's start function.

void * GAUGE3D::GThread::Join ( )
 

Wait for the thread to finish and get the return value.

Returns:
The return value from the threads start function.
Remarks:
This function will not return until the thread has finished executing. Be careful when you call this.

void GAUGE3D::GThread::Detach ( )
 

Call if you will not be joining the thread.

If you do not call this and do not call Join(), some resources associated with the thread may never be freed.

void GAUGE3D::GThread::Return ( void * retVal ) [static]
 

Quit the current thread.

Parameters:
retVal   Value to use as the return value from the start function.

Execution of the thread will not continue after calling this.


The documentation for this class was generated from the following file:
Generated at Tue Jan 30 17:07:34 2001 for gauge3d by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000