]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/threadengines/threadengine_win32.h
Update all wiki links to point to the new wiki. This was done automatically with...
[user/henk/code/inspircd.git] / include / threadengines / threadengine_win32.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
6  * See: http://wiki.inspircd.org/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #ifndef __THREADENGINE_WIN32THREAD__
15 #define __THREADENGINE_WIN32THREAD__
16
17 #include "inspircd_config.h"
18 #include "base.h"
19 #include "threadengine.h"
20
21 class InspIRCd;
22
23 class CoreExport Win32ThreadEngine : public ThreadEngine
24 {
25  protected:
26
27         bool Mutex(bool enable);
28
29  public:
30
31         Win32ThreadEngine(InspIRCd* Instance);
32
33         virtual ~Win32ThreadEngine();
34
35         void Run();
36
37         static DWORD WINAPI Entry(void* parameter);
38
39         void Create(Thread* thread_to_init);
40
41         void FreeThread(Thread* thread);
42
43         const std::string GetName()
44         {
45                 return "windows-thread";
46         }
47 };
48
49 class CoreExport ThreadEngineFactory : public classbase
50 {
51  public:
52         ThreadEngine* Create(InspIRCd* ServerInstance)
53         {
54                 return new Win32ThreadEngine(ServerInstance);
55         }
56 };
57
58 class CoreExport Win32Mutex : public Mutex
59 {
60  private:
61         CRITICAL_SECTION wutex;
62  public:
63         Win32Mutex(InspIRCd* Instance);
64         virtual void Enable(bool enable);
65         ~Win32Mutex();
66 };
67
68 class CoreExport MutexFactory : public Extensible
69 {
70  protected:
71         InspIRCd* ServerInstance;
72  public:
73         MutexFactory(InspIRCd* Instance);
74         virtual Mutex* CreateMutex();
75 };
76
77 #endif
78