* is responsible for destroying it.
*/
virtual void FreeThread(Thread* thread) = 0;
+
+ virtual const std::string GetName()
+ {
+ return "<pure-virtual>";
+ }
};
/** Derive from this class to implement your own threaded sections of
*/
class CoreExport Thread : public Extensible
{
+ private:
+ bool ExitFlag;
public:
/** Creator thread engine
/** Set Creator to NULL at this point
*/
- Thread() : Creator(NULL)
+ Thread() : ExitFlag(false), Creator(NULL)
{
}
* threaded code here
*/
virtual void Run() = 0;
+
+ void SetExitFlag()
+ {
+ ExitFlag = true;
+ }
+
+ void ClearExitFlag()
+ {
+ ExitFlag = false;
+ }
+
+ bool GetExitFlag()
+ {
+ return ExitFlag;
+ }
};