]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/threadengines/threadengine_win32.h
These are just copies of the pthread engine right now, will probably make them work...
[user/henk/code/inspircd.git] / include / threadengines / threadengine_win32.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
6  * See: http://www.inspircd.org/wiki/index.php/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #ifndef __THREADENGINE_PTHREAD__
15 #define __THREADENGINE_PTHREAD__
16
17 #include <pthread.h>
18 #include "inspircd_config.h"
19 #include "base.h"
20 #include "threadengine.h"
21
22 class InspIRCd;
23
24 class CoreExport Win32ThreadEngine : public ThreadEngine
25 {
26  public:
27
28         Win32ThreadEngine(InspIRCd* Instance);
29
30         virtual ~Win32ThreadEngine();
31
32         bool Mutex(bool enable);
33
34         void Run();
35
36         static void* Entry(void* parameter);
37
38         void Create(Thread* thread_to_init);
39
40         void FreeThread(Thread* thread);
41
42         const std::string GetName()
43         {
44                 return "windows-thread";
45         }
46 };
47
48 class ThreadEngineFactory : public classbase
49 {
50  public:
51         ThreadEngine* Create(InspIRCd* ServerInstance)
52         {
53                 return new Win32ThreadEngine(ServerInstance);
54         }
55 };
56
57 #endif
58