|
Yate
|
#include <yateclass.h>
Public Member Functions | |
| Mutex (bool recursive=false, const char *name=0) | |
| Mutex (const Mutex &original) | |
| ~Mutex () | |
| Mutex & | operator= (const Mutex &original) |
| virtual bool | lock (long maxwait=-1) |
| virtual bool | unlock () |
| virtual bool | locked () const |
| const char * | owner () const |
| bool | recursive () const |
Public Member Functions inherited from Lockable | |
| virtual | ~Lockable () |
| virtual bool | check (long maxwait=-1) |
| virtual bool | unlockAll () |
Static Public Member Functions | |
| static int | count () |
| static int | locks () |
| static bool | efficientTimedLock () |
Static Public Member Functions inherited from Lockable | |
| static void | wait (unsigned long maxwait) |
| static unsigned long | wait () |
| static void | startUsingNow () |
| static void | enableSafety (bool safe=true) |
| static bool | safety () |
Friends | |
| class | MutexPrivate |
Mutex support.
A simple mutual exclusion for locking access between threads
|
explicit |
Construct a new unlocked mutex
| recursive | True if the mutex has to be recursive (reentrant), false for a normal fast mutex |
| name | Static name of the mutex (for debugging purpose only) |
References recursive().
Referenced by IAXEngine::bind(), ClientAccountList::ClientAccountList(), DataSource::DataSource(), JBEntityCapsList::JBEntityCapsList(), Mutex(), operator=(), ScriptMutex::ScriptMutex(), SDPParser::SDPParser(), SharedVars::SharedVars(), SIPSequence::SIPSequence(), SS7Route::SS7Route(), SS7Route::SS7Route(), and SS7Testing::SS7Testing().
Copy constructor, creates a shared mutex
| original | Reference of the mutex to share |
References Mutex().
| ~Mutex | ( | ) |
Destroy the mutex
|
static |
Get the number of mutexes counting the shared ones only once
|
static |
Check if a timed lock() is efficient on this platform
|
virtual |
Attempt to lock the mutex and eventually wait for it
| maxwait | Time in microseconds to wait for the mutex, -1 wait forever |
Implements Lockable.
Referenced by JBEntityCapsList::addCaps(), JBServerStream::adjustDbRsp(), SIPEngine::append(), SccpLocalSubsystem::appendBackup(), MGCPEndpoint::clear(), SccpLocalSubsystem::clearBackups(), SignallingCall::clearQueue(), SDPParser::getAudioFormats(), JBServerEngine::getStreamIndex(), SIPEngine::insert(), JBStream::isId(), MGCPEngine::knownCommand(), JBStream::local(), JBStream::localAddr(), JBStream::remote(), JBStream::remoteAddr(), SIPEngine::remove(), SignallingCircuitGroup::setStrategy(), SS7ISUPCall::setTerminate(), JBStream::setTlsRequired(), SCCPManagement::stopSSTs(), JBServerStream::takeDb(), JBClientStream::userData(), AnalogLine::userdata(), and SignallingCallControl::verify().
|
virtual |
Check if the mutex is currently locked - as it's asynchronous it guarantees nothing if other thread changes the mutex's status
Implements Lockable.
|
static |
Get the number of currently locked mutexes
Assignment operator makes the mutex shared with the original
| original | Reference of the mutex to share |
References Mutex().
| const char * owner | ( | ) | const |
Retrieve the name of the Thread (if any) holding the Mutex locked
Referenced by JBStreamSet::JBStreamSet(), JBStreamSetProcessor::JBStreamSetProcessor(), and JBStreamSetReceive::JBStreamSetReceive().
| bool recursive | ( | ) | const |
Check if this mutex is recursive or not
Referenced by Mutex(), and ScriptMutex::ScriptMutex().
|
virtual |
Unlock the mutex, does never wait
Implements Lockable.
Referenced by SIPEngine::append(), MGCPEndpoint::clear(), SIPEngine::insert(), and SIPEngine::remove().