VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

Abstract Threading Class Provides a system independent thread object. More...

+ Collaboration diagram for DtThread:

Public Member Functions

 DtThread (DtThreadStartSP threadStart)
 Constructor. More...
 
virtual ~DtThread ()
 Destructor. More...
 
virtual DtThreadStatus start ()
 Over-ride run to implement thread execution. More...
 
DtThreadStatus startInCurrentThread ()
 Execute within the current thread ( does not start a new thread ) More...
 
void stop (bool blocking)
 Signals Thread to stop. More...
 
bool hasStarted () const
 Has the thread been started. More...
 
bool isRunning () const
 Is thread still active? This is true once the thread has actually started executing. More...
 
DtThreadStatus join () const
 Wait for thread to finish (blocking). More...
 
DtThreadHandle threadId () const
 Get the thread's ID. More...
 
void run ()
 

Static Public Member Functions

static DtThreadId GetCurrentThreadHandle ()
 Return a unique id for the current thread (useful for thread-specific mapping) More...
 

Protected Member Functions

bool stopped ()
 Has stop() been called? More...
 

Protected Attributes

DtThreadHandle myThreadID
 System Independent Thread Handle. More...
 

Private Member Functions

 DtThread (const DtThread &orig)
 Copy Ctor and Assign Op. undefined for threads. More...
 
DtThreadoperator= (const DtThread &orig)
 

Private Attributes

volatile bool myTimeToStop
 Stop Flag. More...
 
bool myRunning
 Active status Flag. More...
 
DtThreadStartSP myThreadStart
 
DtMutex myMutex
 Shared lock for protecting critical sections. More...
 

Detailed Description

Abstract Threading Class Provides a system independent thread object.

Constructor & Destructor Documentation

DtThread::DtThread ( DtThreadStartSP  threadStart)

Constructor.

virtual DtThread::~DtThread ( )
virtual

Destructor.

DtThread::DtThread ( const DtThread orig)
private

Copy Ctor and Assign Op. undefined for threads.

Member Function Documentation

static DtThreadId DtThread::GetCurrentThreadHandle ( )
static

Return a unique id for the current thread (useful for thread-specific mapping)

bool DtThread::hasStarted ( ) const

Has the thread been started.

This true for all times after start() has been called including when the thread has stopped on it's own. The running flag will be set to false after a thread has stopped.

bool DtThread::isRunning ( ) const

Is thread still active? This is true once the thread has actually started executing.

Immediately after start this will still return false. When

DtThreadStatus DtThread::join ( ) const

Wait for thread to finish (blocking).

DtThread& DtThread::operator= ( const DtThread orig)
private
void DtThread::run ( )
virtual DtThreadStatus DtThread::start ( )
virtual

Over-ride run to implement thread execution.

DtThreadStatus DtThread::startInCurrentThread ( )

Execute within the current thread ( does not start a new thread )

void DtThread::stop ( bool  blocking)

Signals Thread to stop.

  • Stopped() will return true after call to Stop()
  • User-defined Run method must test Stopped() to accept stop command
bool DtThread::stopped ( )
protected

Has stop() been called?

  • Run() should test Stopped() and halt when true
DtThreadHandle DtThread::threadId ( ) const
inline

Get the thread's ID.

Member Data Documentation

DtMutex DtThread::myMutex
mutableprivate

Shared lock for protecting critical sections.

  • lock is mutable since it may be used in const members
bool DtThread::myRunning
private

Active status Flag.

DtThreadHandle DtThread::myThreadID
protected

System Independent Thread Handle.

DtThreadStartSP DtThread::myThreadStart
private
volatile bool DtThread::myTimeToStop
private

Stop Flag.


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

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)