summaryrefslogtreecommitdiff
path: root/src/threadengine.cpp
blob: e11b065ea077c7aea77a9b82d822a7642ee04b00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "services.h"

/** Threads constructor
 */
Thread::Thread() : exit(false)
{
}

/** Threads destructor
 */
Thread::~Thread()
{
}

/** Sets the exit state as true informing the thread we want it to shut down
 */
void Thread::SetExitState()
{
	this->Notify();
	exit = true;
}

/** Returns the exit state of the thread
 * @return true if we want to exit
 */
bool Thread::GetExitState() const
{
	return exit;
}

/** Called when this thread should be joined to
 */
void Thread::OnNotify()
{
	this->Join();
	this->SetFlag(SF_DEAD);
}