]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/threadengines/threadengine_pthread.h
Add a setting to <connect> allowing the threshold for activation of the penalty syste...
[user/henk/code/inspircd.git] / include / threadengines / threadengine_pthread.h
index 2aba4cb159c95225a54ebc82594ccadf39faa58d..4952ea3e8782369c87713c7c28d4040398bc8768 100644 (file)
@@ -18,7 +18,6 @@
 #include "inspircd_config.h"
 #include "base.h"
 
-class InspIRCd;
 class Thread;
 
 /** The ThreadEngine class has the responsibility of initialising
@@ -31,14 +30,14 @@ class Thread;
  * access non-threadsafe code from a Thread, use the Mutex class to wrap
  * access to the code carefully.
  */
-class CoreExport ThreadEngine : public Extensible
+class CoreExport ThreadEngine
 {
  public:
 
        /** Constructor.
         * @param Instance Creator object
         */
-       ThreadEngine(InspIRCd* Instance);
+       ThreadEngine();
 
        /** Destructor
         */
@@ -107,4 +106,50 @@ class CoreExport Mutex
        }
 };
 
+class ThreadQueueData
+{
+       pthread_mutex_t mutex;
+       pthread_cond_t cond;
+ public:
+       ThreadQueueData()
+       {
+               pthread_mutex_init(&mutex, NULL);
+               pthread_cond_init(&cond, NULL);
+       }
+
+       ~ThreadQueueData()
+       {
+               pthread_mutex_destroy(&mutex);
+               pthread_cond_destroy(&cond);
+       }
+
+       void Lock()
+       {
+               pthread_mutex_lock(&mutex);
+       }
+
+       void Unlock()
+       {
+               pthread_mutex_unlock(&mutex);
+       }
+
+       void Wakeup()
+       {
+               pthread_cond_signal(&cond);
+       }
+
+       void Wait()
+       {
+               pthread_cond_wait(&cond, &mutex);
+       }
+};
+
+class ThreadSignalSocket;
+class ThreadSignalData
+{
+ public:
+       ThreadSignalSocket* sock;
+};
+
+
 #endif