1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 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_WIN32THREAD__
15 #define __THREADENGINE_WIN32THREAD__
17 #include "inspircd_config.h"
19 #include "threadengine.h"
23 class CoreExport Win32ThreadEngine : public ThreadEngine
27 bool Mutex(bool enable);
31 Win32ThreadEngine(InspIRCd* Instance);
33 virtual ~Win32ThreadEngine();
37 static DWORD WINAPI Entry(void* parameter);
39 void Create(Thread* thread_to_init);
41 void FreeThread(Thread* thread);
43 const std::string GetName()
45 return "windows-thread";
49 class CoreExport ThreadEngineFactory : public classbase
52 ThreadEngine* Create(InspIRCd* ServerInstance)
54 return new Win32ThreadEngine(ServerInstance);
58 class CoreExport Win32Mutex : public Mutex
61 CRITICAL_SECTION wutex;
63 Win32Mutex(InspIRCd* Instance);
64 virtual void Enable(bool enable);
68 class CoreExport MutexFactory : public Extensible
71 InspIRCd* ServerInstance;
73 MutexFactory(InspIRCd* Instance);
74 virtual Mutex* CreateMutex();