]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/threadengine.h
Add threading engine stuff. Docs to follow, untested and not used anywhere yet
[user/henk/code/inspircd.git] / include / threadengine.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__
15 #define __THREADENGINE__
16
17 #include <vector>
18 #include <string>
19 #include <map>
20 #include "inspircd_config.h"
21 #include "base.h"
22
23 class InspIRCd;
24
25 class CoreExport Thread : public Extensible
26 {
27  public:
28         Thread() { };
29         virtual ~Thread() { };
30         virtual void Run() = 0;
31 };
32
33 class CoreExport ThreadEngine : public Extensible
34 {
35  protected:
36
37          InspIRCd* ServerInstance;
38          Thread* NewThread;
39
40  public:
41
42         ThreadEngine(InspIRCd* Instance);
43
44         virtual ~ThreadEngine();
45
46         virtual bool Mutex(bool enable) = 0;
47
48         virtual void Run() = 0;
49
50         virtual void Create(Thread* thread_to_init) = 0;
51 };
52
53 #endif