HCE project C++ developers source code library  1.1.1
HCE project developer library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Thread.cpp
Go to the documentation of this file.
1 #include "Thread.hpp"
2 
3 HCE::Utils::Thread::Thread ():_exitFlag(false){}
4 
6 
7 }
8 
10  if (!this->_ownThread.isRunning()) {
11  this->_ownThread.start(*this);
12  }
13  else {
14  throw HCE::ThreadAlreadyRunningException("Thread already running.");
15  }
16 }
17 
19  if (this->_exitFlag == false) {
20  this->_exitFlag = true;
21  }
22  else {
23  //...
24  }
25 }
26 
28  if (this->_ownThread.isRunning()) {
29  this->_ownThread.join();
30  }
31  else {
32  throw HCE::ThreadAlreadyJoinedException ("Thread already join.");
33  }
34 }
35 
37  return this->_ownThread.isRunning();
38 }