xoreos
0.0.5
|
A class that creates its own thread. More...
#include <thread.h>
Public Member Functions | |
Thread () | |
virtual | ~Thread () |
bool | createThread (const UString &name="") |
bool | destroyThread () |
Protected Attributes | |
boost::atomic< bool > | _killThread |
Private Member Functions | |
virtual void | threadMethod ()=0 |
Static Private Member Functions | |
static int | threadHelper (void *obj) |
Private Attributes | |
SDL_Thread * | _thread |
Common::UString | _name |
boost::atomic< bool > | _threadRunning |
Common::Thread::Thread | ( | ) |
Definition at line 37 of file thread.cpp.
|
virtual |
Definition at line 40 of file thread.cpp.
References destroyThread().
bool Common::Thread::createThread | ( | const UString & | name = "" | ) |
Definition at line 44 of file thread.cpp.
References _name, _thread, _threadRunning, Common::UString::c_str(), Common::UString::empty(), threadHelper(), and warning().
Referenced by Sound::SoundManager::init(), Events::RequestManager::init(), Graphics::GraphicsManager::init(), and Engines::GameThread::run().
bool Common::Thread::destroyThread | ( | ) |
Definition at line 64 of file thread.cpp.
References _killThread, _name, _thread, _threadRunning, Common::UString::c_str(), and warning().
Referenced by Sound::SoundManager::deinit(), Events::RequestManager::deinit(), Graphics::GraphicsManager::deinit(), Engines::GameThread::~GameThread(), and ~Thread().
|
staticprivate |
Definition at line 106 of file thread.cpp.
References _threadRunning, and threadMethod().
Referenced by createThread().
|
privatepure virtual |
Implemented in Sound::SoundManager, Events::RequestManager, Graphics::Aurora::AnimationThread, and Engines::GameThread.
Referenced by threadHelper().
|
protected |
Definition at line 53 of file thread.h.
Referenced by destroyThread(), Graphics::Aurora::AnimationThread::threadMethod(), Events::RequestManager::threadMethod(), and Sound::SoundManager::threadMethod().
|
private |
Definition at line 57 of file thread.h.
Referenced by createThread(), and destroyThread().
|
private |
Definition at line 56 of file thread.h.
Referenced by createThread(), and destroyThread().
|
private |
Definition at line 59 of file thread.h.
Referenced by createThread(), destroyThread(), and threadHelper().