deThread Class Reference

Thread. More...

#include <deThread.h>

Inheritance diagram for deThread:
deResourceLoaderThread

List of all members.

Public Member Functions

Constructors and Destructors
 deThread ()
 Creates a thread.
virtual ~deThread ()
 Cleans the thread.
Management
bool IsRunning ()
 Determines if the thread is running.
void Start ()
 Starts the thread if not running already.
void Stop ()
 Stops the thread.
void WaitForExit ()
 Waits for the thread to end and then returns.
virtual void Run ()=0
 Run function of the thread.

Detailed Description

Thread.

Runs a thread. Thin layer over the operating system thread support. Subclass to add your own run function.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Constructor & Destructor Documentation

deThread::deThread (  )

Creates a thread.

virtual deThread::~deThread (  ) [virtual]

Cleans the thread.


Member Function Documentation

bool deThread::IsRunning (  )

Determines if the thread is running.

virtual void deThread::Run (  ) [pure virtual]

Run function of the thread.

Overwrite to implement what the threa is supposed to be doing. Once this function ends the thread is stopped.

Implemented in deResourceLoaderThread.

void deThread::Start (  )

Starts the thread if not running already.

void deThread::Stop (  )

Stops the thread.

Returns as soon as the thread stopped.

void deThread::WaitForExit (  )

Waits for the thread to end and then returns.

This is the safe way to end a thread especially if mutices or semaphores are used. Make sure the thread ends soon or else this call deadlocks your application.


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