1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 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__
15 #define __THREADENGINE__
20 #include "inspircd_config.h"
27 class CoreExport ThreadEngine : public Extensible
31 InspIRCd* ServerInstance;
36 ThreadEngine(InspIRCd* Instance);
38 virtual ~ThreadEngine();
40 virtual bool Mutex(bool enable) = 0;
42 virtual void Run() = 0;
44 virtual void Create(Thread* thread_to_init) = 0;
46 virtual void FreeThread(Thread* thread) = 0;
49 class CoreExport Thread : public Extensible
53 ThreadEngine* Creator;
55 Thread() : Creator(NULL)
62 Creator->FreeThread(this);
65 virtual void Run() = 0;