X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fthreadengine.h;h=655e5bff2a4cc1f4b78be9b49d5fe9b0e97d2ea7;hb=b06d9c4ad43875f3f6dae178b32b6c1c91e6eb2f;hp=d41ad98d30c7e5147b1eadc590da64d94f9a2c95;hpb=da011c234878c0520439949c8b12922f131c8a8c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/threadengine.h b/include/threadengine.h index d41ad98d3..655e5bff2 100644 --- a/include/threadengine.h +++ b/include/threadengine.h @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team + * InspIRCd: (C) 2002-2009 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -40,10 +40,21 @@ class CoreExport ThreadEngine : public Extensible /** Creator instance */ InspIRCd* ServerInstance; + /** New Thread being created. */ Thread* NewThread; + /** Enable or disable system-wide mutex for threading. + * Remember that if you toggle the mutex you MUST UNSET + * IT LATER otherwise the program will DEADLOCK! + * It is recommended that you AVOID USE OF THIS METHOD + * and use your own Mutex class, this function is mainly + * reserved for use by the core and by the Thread engine + * itself. + * @param enable True to lock the mutex. + */ + virtual bool Mutex(bool enable) = 0; public: /** Constructor. @@ -55,16 +66,15 @@ class CoreExport ThreadEngine : public Extensible */ virtual ~ThreadEngine(); - /** Enable or disable system-wide mutex for threading. - * Remember that if you toggle the mutex you MUST UNSET - * IT LATER otherwise the program will DEADLOCK! - * It is recommended that you AVOID USE OF THIS METHOD - * and use your own Mutex class, this function is mainly - * reserved for use by the core and by the Thread engine - * itself. - * @param enable True to lock the mutex. + /** Lock the system wide mutex. See the documentation for + * ThreadEngine::Mutex(). + */ + void Lock() { this->Mutex(true); } + + /** Unlock the system wide mutex. See the documentation for + * ThreadEngine::Mutex() */ - virtual bool Mutex(bool enable) = 0; + void Unlock() { this->Mutex(false); } /** Run the newly created thread. */