summaryrefslogtreecommitdiff
path: root/include/threadengine.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/threadengine.h')
-rw-r--r--include/threadengine.h32
1 files changed, 25 insertions, 7 deletions
diff --git a/include/threadengine.h b/include/threadengine.h
index 7d27b867a..0f729a962 100644
--- a/include/threadengine.h
+++ b/include/threadengine.h
@@ -21,14 +21,8 @@
#include "base.h"
class InspIRCd;
+class Thread;
-class CoreExport Thread : public Extensible
-{
- public:
- Thread() { };
- virtual ~Thread() { };
- virtual void Run() = 0;
-};
class CoreExport ThreadEngine : public Extensible
{
@@ -48,6 +42,30 @@ class CoreExport ThreadEngine : public Extensible
virtual void Run() = 0;
virtual void Create(Thread* thread_to_init) = 0;
+
+ virtual void FreeThread(Thread* thread) = 0;
};
+class CoreExport Thread : public Extensible
+{
+ public:
+
+ ThreadEngine* Creator;
+
+ Thread() : Creator(NULL)
+ {
+ }
+
+ virtual ~Thread()
+ {
+ if (Creator)
+ Creator->FreeThread(this);
+ }
+
+ virtual void Run() = 0;
+};
+
+
+
#endif
+