1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
14 #ifndef __THREADENGINE_PTHREAD__
15 #define __THREADENGINE_PTHREAD__
18 #include "inspircd_config.h"
20 #include "threadengine.h"
24 class CoreExport PThreadEngine : public ThreadEngine
28 bool Mutex(bool enable);
32 PThreadEngine(InspIRCd* Instance);
34 virtual ~PThreadEngine();
38 static void* Entry(void* parameter);
40 void Create(Thread* thread_to_init);
42 void FreeThread(Thread* thread);
44 const std::string GetName()
46 return "posix-thread";
50 class CoreExport ThreadEngineFactory : public classbase
53 ThreadEngine* Create(InspIRCd* ServerInstance)
55 return new PThreadEngine(ServerInstance);
59 class CoreExport PosixMutex : public Mutex
62 pthread_mutex_t putex;
64 PosixMutex(InspIRCd* Instance);
65 virtual void Enable(bool enable);
69 class CoreExport MutexFactory : public Extensible
72 InspIRCd* ServerInstance;
74 MutexFactory(InspIRCd* Instance);