]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/threadengine.h
Allow maxtargets to be bypassed in LoopCall for JOIN
[user/henk/code/inspircd.git] / include / threadengine.h
index c11f2d817734d58a7de096b2836a8cf20b843a63..32b53e2171b7c11f883bcb862448620e71467d3e 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -30,7 +30,7 @@ class ThreadData;
  * code. Be sure to keep your code thread-safe and not prone to deadlocks
  * and race conditions if you MUST use threading!
  */
-class CoreExport Thread : public Extensible
+class CoreExport Thread
 {
  private:
        /** Set to true when the thread is to exit
@@ -55,6 +55,7 @@ class CoreExport Thread : public Extensible
        {
        }
 
+       /* If the thread is running, you MUST join BEFORE deletion */
        virtual ~Thread();
 
        /** Override this method to put your actual
@@ -64,10 +65,11 @@ class CoreExport Thread : public Extensible
 
        /** Signal the thread to exit gracefully.
         */
-       virtual void SetExitFlag()
-       {
-               ExitFlag = true;
-       }
+       virtual void SetExitFlag();
+
+       /** Join the thread (calls SetExitFlag and waits for exit)
+        */
+       void join();
 };
 
 
@@ -132,7 +134,7 @@ class CoreExport SocketThread : public Thread
         */
        void NotifyParent();
  public:
-       SocketThread(InspIRCd* SI);
+       SocketThread();
        virtual ~SocketThread();
        /** Lock queue.
         */