#include <LockMechanism.h>
Inherited by CMessagePool, CPacketQueue, CPeerList, and CResponseWaitQueue.
Public Member Functions | |
CLockMechanism () | |
Constructor. | |
virtual | ~CLockMechanism () |
Destructor. | |
bool | lock () |
Lock the Object. | |
void | unlock () |
Unlock the Object. | |
void | setTimeoutMsec (UINT32 timeout) |
set the timeout constant | |
UINT32 | getTimeoutMsec () |
read back the timeout constant | |
Protected Attributes | |
HANDLE | m_hMutex |
platform handle; used to lock/unlock object | |
UINT32 | m_uiTimeoutMsec |
Implementation of a platform independent mutex object in order to synchronize multiple thread or multiple task access. Used inside ResponseWaitQueue, PacketQueue, MessageBuffers
The receiver will acknowlegde the command by calling Ack().
Definition at line 12 of file LockMechanism.h.
CLockMechanism::CLockMechanism | ( | ) |
CLockMechanism::~CLockMechanism | ( | ) | [virtual] |
bool CLockMechanism::lock | ( | ) |
Lock the Object.
true | The object has been locked. | |
false | The object could not be locked (f.ex. got timeout). |
Definition at line 42 of file LockMechanism.cpp.
Referenced by CMessagePool::acquire_reference(), CPeerList::add(), CMessagePool::Deinitialize(), CResponseWaitQueue::find_and_remove_elem(), CPacketQueue::find_and_remove_elem(), CPacketQueue::find_and_remove_passed_elem(), CResponseWaitQueue::find_elem(), CPacketQueue::find_elem(), CPacketQueue::find_elem_ack_and_signal(), CPeerList::getReceivePacketIndex(), CPeerList::getSendPacketIndex(), CMessagePool::increment_referencecount(), CPeerList::incSendPacketIndex(), CMessagePool::Initialize(), CPeerList::isAllowed(), CPacketQueue::pop_front(), CResponseWaitQueue::push_back(), CPacketQueue::push_back(), CMessagePool::putback_reference(), CPeerList::remove(), CResponseWaitQueue::remove_elem(), CPacketQueue::remove_elem(), CPeerList::removeAll(), CPacketQueue::setQueueMaxsize(), and CPeerList::setReceivePacketIndex().
void CLockMechanism::unlock | ( | ) |
Unlock the Object.
Definition at line 54 of file LockMechanism.cpp.
Referenced by CMessagePool::acquire_reference(), CPeerList::add(), CMessagePool::Deinitialize(), CResponseWaitQueue::find_and_remove_elem(), CPacketQueue::find_and_remove_elem(), CPacketQueue::find_and_remove_passed_elem(), CResponseWaitQueue::find_elem(), CPacketQueue::find_elem(), CPacketQueue::find_elem_ack_and_signal(), CPeerList::getReceivePacketIndex(), CPeerList::getSendPacketIndex(), CMessagePool::increment_referencecount(), CPeerList::incSendPacketIndex(), CMessagePool::Initialize(), CPeerList::isAllowed(), CPacketQueue::pop_front(), CResponseWaitQueue::push_back(), CPacketQueue::push_back(), CMessagePool::putback_reference(), CPeerList::remove(), CResponseWaitQueue::remove_elem(), CPacketQueue::remove_elem(), CPeerList::removeAll(), CPacketQueue::setQueueMaxsize(), and CPeerList::setReceivePacketIndex().
void CLockMechanism::setTimeoutMsec | ( | UINT32 | timeout | ) |
UINT32 CLockMechanism::getTimeoutMsec | ( | ) |
HANDLE CLockMechanism::m_hMutex [protected] |
platform handle; used to lock/unlock object
Definition at line 32 of file LockMechanism.h.
Referenced by CLockMechanism(), lock(), unlock(), and ~CLockMechanism().
UINT32 CLockMechanism::m_uiTimeoutMsec [protected] |
Definition at line 33 of file LockMechanism.h.
Referenced by CLockMechanism(), getTimeoutMsec(), lock(), and setTimeoutMsec().