EvEmu
0.8.4
11 September 2021
|
Common wrapper for platform-specific mutexes. More...
#include "Mutex.h"
Public Member Functions | |
Mutex () | |
Primary contructor. More... | |
~Mutex () | |
Destructor, releases allocated resources. More... | |
void | Lock () |
Locks the mutex. More... | |
bool | TryLock () |
Attempts to lock the mutex. More... | |
void | Unlock () |
Unlocks the mutex. More... | |
Protected Attributes | |
pthread_mutex_t | mMutex |
A pthread mutex used for mutex implementation using pthread library. More... | |
Mutex::Mutex | ( | ) |
Primary contructor.
Definition at line 33 of file Mutex.cpp.
References mMutex.
Mutex::~Mutex | ( | ) |
Destructor, releases allocated resources.
Definition at line 48 of file Mutex.cpp.
References mMutex.
|
virtual |
Locks the mutex.
Implements Lockable.
Definition at line 57 of file Mutex.cpp.
References mMutex.
Referenced by TCPConnection::AsyncConnect(), TCPConnection::Connect(), BaseTCPServer::IsOpen(), BaseTCPServer::Open(), MRMutex::ReadLockCount(), TCPConnection::SendData(), TCPConnection::TCPConnectionLoop(), BaseTCPServer::TCPServerLoop(), MRMutex::TryReadLock(), MRMutex::TryWriteLock(), MRMutex::UnReadLock(), MRMutex::UnWriteLock(), BaseTCPServer::WaitLoop(), TCPConnection::WaitLoop(), MRMutex::WriteLock(), and MRMutex::WriteLockCount().
|
virtual |
Attempts to lock the mutex.
Implements Lockable.
Definition at line 66 of file Mutex.cpp.
References mMutex.
Referenced by DBcore::ping().
|
virtual |
Unlocks the mutex.
Implements Lockable.
Definition at line 75 of file Mutex.cpp.
References mMutex.
Referenced by TCPConnection::AsyncConnect(), TCPConnection::Connect(), BaseTCPServer::IsOpen(), BaseTCPServer::Open(), DBcore::ping(), MRMutex::ReadLockCount(), TCPConnection::SendData(), TCPConnection::TCPConnectionLoop(), BaseTCPServer::TCPServerLoop(), MRMutex::TryReadLock(), MRMutex::TryWriteLock(), MRMutex::UnReadLock(), MRMutex::UnWriteLock(), BaseTCPServer::WaitLoop(), TCPConnection::WaitLoop(), MRMutex::WriteLock(), and MRMutex::WriteLockCount().
|
protected |