|
|||
|
|||
|
#include <threadengine.h>
Inheritance diagram for Mutex:


Public Member Functions | |
| Mutex (InspIRCd *Instance) | |
| Constructor. | |
| void | Lock () |
| Enter/enable the mutex lock. | |
| void | Unlock () |
| Leave/disable the mutex lock. | |
| ~Mutex () | |
| Destructor. | |
Protected Member Functions | |
| virtual void | Enable (bool enable)=0 |
| Enable or disable the Mutex. | |
Protected Attributes | |
| InspIRCd * | ServerInstance |
| Creator object. | |
Use mutexes sparingly, as they are a good source of thread deadlocks etc, and should be avoided except where absolutely neccessary. Note that the internal behaviour of the mutex varies from OS to OS depending on the thread engine, for example in windows a Mutex in InspIRCd uses critical sections, as they are faster and simpler to manage.
Definition at line 115 of file threadengine.h.
|
|
Constructor.
Definition at line 31 of file threadengine.cpp. |
|
|
Destructor.
Definition at line 149 of file threadengine.h. |
|
|
Enable or disable the Mutex. This method has somewhat confusing wording (e.g. the function name and parameters) so it is protected in preference of the Lock() and Unlock() methods which are user- accessible.
|
|
|
Enter/enable the mutex lock.
Definition at line 141 of file threadengine.h. Referenced by ModuleMsSQL::AddConn(), ConnectDatabases(), SQLConnection::DoLeadingQuery(), SQLConn::HandleError(), SQLConn::HandleMessage(), LoadDatabases(), ModuleMsSQL::ModuleMsSQL(), ModuleSQL::ModuleSQL(), Notifier::OnDataReady(), ModuleMsSQL::OnRehash(), ModuleSQL::OnRequest(), ModuleMsSQL::OnRequest(), SQLConn::Query(), DispatcherThread::Run(), QueryThread::Run(), SQLConn::SendResults(), and SQLConn::SQLConn(). |
|
|
Leave/disable the mutex lock.
Definition at line 145 of file threadengine.h. Referenced by ModuleMsSQL::AddConn(), ConnectDatabases(), SQLConnection::DoLeadingQuery(), SQLConn::HandleError(), SQLConn::HandleMessage(), LoadDatabases(), ModuleMsSQL::ModuleMsSQL(), ModuleSQL::ModuleSQL(), Notifier::OnDataReady(), ModuleMsSQL::OnRehash(), ModuleSQL::OnRequest(), ModuleMsSQL::OnRequest(), SQLConn::Query(), DispatcherThread::Run(), QueryThread::Run(), SQLConn::SendResults(), and SQLConn::SQLConn(). |
|
|
Creator object.
Definition at line 121 of file threadengine.h. |