summaryrefslogtreecommitdiff
path: root/include/threadengine.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-09-05 18:44:43 -0400
committerAdam <Adam@anope.org>2011-09-10 02:06:31 -0400
commit63cb8ca24c0d4003343340bb8413b7f84de1a6a3 (patch)
treed71f0cead730065dd8509e284d66b6767e7ebd25 /include/threadengine.h
parentdc5d1fa21c20000b77bf713585333c79121a8df0 (diff)
Moved signal/thread/mode checking to use signal pipes
Diffstat (limited to 'include/threadengine.h')
-rw-r--r--include/threadengine.h41
1 files changed, 11 insertions, 30 deletions
diff --git a/include/threadengine.h b/include/threadengine.h
index 20e3c81eb..06c4900a4 100644
--- a/include/threadengine.h
+++ b/include/threadengine.h
@@ -12,36 +12,9 @@ typedef pthread_mutex_t MutexHandle;
typedef pthread_cond_t CondHandle;
#endif
-class ThreadEngine;
class Thread;
-extern CoreExport ThreadEngine threadEngine;
-
-class CoreExport ThreadEngine
-{
- public:
- /* Vector of threads */
- std::vector<Thread *> threads;
-
- /** Threadengines constructor
- */
- ThreadEngine();
-
- /** Threadengines destructor
- */
- ~ThreadEngine();
-
- /** Start a new thread
- * @param thread A pointer to a newley allocated thread
- */
- void Start(Thread *thread);
-
- /** Check for finished threads
- */
- void Process();
-};
-
-class CoreExport Thread : public Extensible
+class CoreExport Thread : public Pipe, public Extensible
{
private:
/* Set to true to tell the thread to finish and we are waiting for it */
@@ -71,14 +44,22 @@ class CoreExport Thread : public Extensible
*/
void Exit();
+ /** Launch the thread
+ */
+ void Start();
+
/** Returns the exit state of the thread
* @return true if we want to exit
*/
bool GetExitState() const;
- /** Called to run the thread, should be overloaded
+ /** Called when this thread should be joined to
+ */
+ void OnNotify();
+
+ /** Called when the thread is run.
*/
- virtual void Run();
+ virtual void Run() = 0;
};
class CoreExport Mutex