]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/threadengine.h
Remove SpanningTreeProtocolInterface::SendOperNotice - it was translated to a SendSNO...
[user/henk/code/inspircd.git] / include / threadengine.h
index 56ccce4239f44a0fbbddef9c3fac4a89199c69e1..59d425481bc142aca3a878e987b9d514b4f835cd 100644 (file)
@@ -75,6 +75,11 @@ class CoreExport ThreadEngine : public Extensible
         * 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
@@ -82,6 +87,8 @@ class CoreExport ThreadEngine : public Extensible
  */
 class CoreExport Thread : public Extensible
 {
+ private:
+       bool ExitFlag;
  public:
 
        /** Creator thread engine
@@ -90,7 +97,7 @@ class CoreExport Thread : public Extensible
 
        /** Set Creator to NULL at this point
         */
-       Thread() : Creator(NULL)
+       Thread() : ExitFlag(false), Creator(NULL)
        {
        }
 
@@ -107,6 +114,21 @@ class CoreExport Thread : public Extensible
         * threaded code here
         */
        virtual void Run() = 0;
+
+       void SetExitFlag()
+       {
+               ExitFlag = true;
+       }
+
+       void ClearExitFlag()
+       {
+               ExitFlag = false;
+       }
+
+       bool GetExitFlag()
+       {
+               return ExitFlag;
+       }
 };