39#ifndef BLOCXX_GENERIC_RWLOCK_IMPL_HPP_INCLUDE_GUARD_
40#define BLOCXX_GENERIC_RWLOCK_IMPL_HPP_INCLUDE_GUARD_
41#include "blocxx/BLOCXX_config.h"
63template <
typename IdT,
typename CompareT>
120 typedef std::map<IdT, LockerInfo, CompareT>
IdMap;
129template <
typename IdT,
typename CompareT>
137template <
typename IdT,
typename CompareT>
142template <
typename IdT,
typename CompareT>
173 m_lockerInfo.insert(
typename IdMap::value_type(
id, lockerInfo));
179template <
typename IdT,
typename CompareT>
187 if (pInfo ==
m_lockerInfo.end() || !pInfo->second.isReader())
209template <
typename IdT,
typename CompareT>
302 m_lockerInfo.insert(
typename IdMap::value_type(
id, ti));
310template <
typename IdT,
typename CompareT>
318 if (pInfo ==
m_lockerInfo.end() || !pInfo->second.isWriter())
#define BLOCXX_ASSERT(CON)
BLOCXX_ASSERT works similar to the assert() macro, but instead of calling abort(),...
#define BLOCXX_DECLARE_APIEXCEPTION(NAME, LINKAGE_SPEC)
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typical...
#define BLOCXX_THROW(exType, msg)
Throw an exception using FILE and LINE.
The Condition class represents a synchronization device that allows threads to suspend execution and ...
This class is the implementation of the read/write lock.
GenericRWLockImpl(const GenericRWLockImpl &)
void releaseReadLock(const IdT id)
void acquireReadLock(const IdT id, const Timeout &timeout)
std::map< IdT, LockerInfo, CompareT > IdMap
void releaseWriteLock(const IdT id)
GenericRWLockImpl & operator=(const GenericRWLockImpl &)
void acquireWriteLock(const IdT id, const Timeout &timeout)
Condition m_waiting_readers
Condition m_waiting_writers
NonRecursiveMutex m_guard
Note that descriptions of what exceptions may be thrown assumes that object is used correctly,...
Note that descriptions of what exceptions may be thrown assumes that object is used correctly,...
A timeout can be absolute, which means that it will happen at the specified DateTime.
A TimeoutTimer is used by an algorithm to determine when a timeout has expired.
Timeout asAbsoluteTimeout() const
Converts the timer to an absolute timeout.