#include <NQLockMechanism.h>
Inherited by CNQMessagePool, CNQPacketQueue, CNQPeerList, and CNQResponseWaitQueue.
Public Member Functions | |
CNQLockMechanism () | |
Constructor. | |
virtual | ~CNQLockMechanism () |
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 NQLockMechanism.h.
CNQLockMechanism::CNQLockMechanism | ( | ) |
CNQLockMechanism::~CNQLockMechanism | ( | ) | [virtual] |
bool CNQLockMechanism::lock | ( | ) |
Lock the Object.
true | The object has been locked. | |
false | The object could not be locked (f.ex. got timeout). |
Definition at line 45 of file NQLockMechanism.cpp.
Referenced by CNQMessagePool::acquire_reference(), CNQPeerList::add(), CNQMessagePool::Deinitialize(), CNQResponseWaitQueue::find_and_remove_elem(), CNQPacketQueue::find_and_remove_elem(), CNQPacketQueue::find_and_remove_passed_elem(), CNQResponseWaitQueue::find_elem(), CNQPacketQueue::find_elem(), CNQPacketQueue::find_elem_ack_and_signal(), CNQPeerList::getReceivePacketIndex(), CNQPeerList::getSendPacketIndex(), CNQMessagePool::increment_referencecount(), CNQPeerList::incSendPacketIndex(), CNQMessagePool::Initialize(), CNQPeerList::isAllowed(), CNQPacketQueue::pop_front(), CNQResponseWaitQueue::push_back(), CNQPacketQueue::push_back(), CNQMessagePool::putback_reference(), CNQPeerList::remove(), CNQResponseWaitQueue::remove_elem(), CNQPacketQueue::remove_elem(), CNQPeerList::removeAll(), CNQPacketQueue::setQueueMaxsize(), and CNQPeerList::setReceivePacketIndex().
void CNQLockMechanism::unlock | ( | ) |
Unlock the Object.
Definition at line 57 of file NQLockMechanism.cpp.
Referenced by CNQMessagePool::acquire_reference(), CNQPeerList::add(), CNQMessagePool::Deinitialize(), CNQResponseWaitQueue::find_and_remove_elem(), CNQPacketQueue::find_and_remove_elem(), CNQPacketQueue::find_and_remove_passed_elem(), CNQResponseWaitQueue::find_elem(), CNQPacketQueue::find_elem(), CNQPacketQueue::find_elem_ack_and_signal(), CNQPeerList::getReceivePacketIndex(), CNQPeerList::getSendPacketIndex(), CNQMessagePool::increment_referencecount(), CNQPeerList::incSendPacketIndex(), CNQMessagePool::Initialize(), CNQPeerList::isAllowed(), CNQPacketQueue::pop_front(), CNQResponseWaitQueue::push_back(), CNQPacketQueue::push_back(), CNQMessagePool::putback_reference(), CNQPeerList::remove(), CNQResponseWaitQueue::remove_elem(), CNQPacketQueue::remove_elem(), CNQPeerList::removeAll(), CNQPacketQueue::setQueueMaxsize(), and CNQPeerList::setReceivePacketIndex().
void CNQLockMechanism::setTimeoutMsec | ( | UINT32 | timeout | ) |
UINT32 CNQLockMechanism::getTimeoutMsec | ( | ) |
HANDLE CNQLockMechanism::m_hMutex [protected] |
platform handle; used to lock/unlock object
Definition at line 32 of file NQLockMechanism.h.
Referenced by CNQLockMechanism(), lock(), unlock(), and ~CNQLockMechanism().
UINT32 CNQLockMechanism::m_uiTimeoutMsec [protected] |
Definition at line 33 of file NQLockMechanism.h.
Referenced by CNQLockMechanism(), getTimeoutMsec(), lock(), and setTimeoutMsec().