#include "inspircd_config.h"
#include "base.h"
-class InspIRCd;
class Thread;
/** The ThreadEngine class has the responsibility of initialising
* 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
*/
}
};
+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