1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/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 PThreadEngine(InspIRCd* Instance);
30 virtual ~PThreadEngine();
32 void Start(Thread* thread_to_init);
34 void FreeThread(Thread* thread);
36 const std::string GetName()
38 return "posix-thread";
42 class CoreExport ThreadEngineFactory : public classbase
45 ThreadEngine* Create(InspIRCd* ServerInstance)
47 return new PThreadEngine(ServerInstance);
51 class CoreExport PThreadData : public ThreadData
55 void FreeThread(Thread* toFree);
58 class CoreExport PosixMutex : public Mutex
61 pthread_mutex_t putex;
64 virtual void Enable(bool enable);
68 class CoreExport MutexFactory : public Extensible
71 InspIRCd* ServerInstance;
73 MutexFactory(InspIRCd* Instance);