]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/threadengines/threadengine_pthread.h
Now buildble.
[user/henk/code/inspircd.git] / include / threadengines / threadengine_pthread.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 PThreadEngine : public ThreadEngine
25 {
26  public:
27
28         PThreadEngine(InspIRCd* Instance);
29
30         virtual ~PThreadEngine();
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
43 class ThreadEngineFactory : public classbase
44 {
45  public:
46         ThreadEngine* Create(InspIRCd* ServerInstance)
47         {
48                 return new PThreadEngine(ServerInstance);
49         }
50 };
51
52 #endif