X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fthreadengine.h;h=59d425481bc142aca3a878e987b9d514b4f835cd;hb=8c2d96013084de950e3a63be4ae6ed626c4093ab;hp=56ccce4239f44a0fbbddef9c3fac4a89199c69e1;hpb=2cc6856e8709c9a5c339ab4af1c0d0b9a01ed917;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/threadengine.h b/include/threadengine.h index 56ccce423..59d425481 100644 --- a/include/threadengine.h +++ b/include/threadengine.h @@ -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 ""; + } }; /** 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; + } };