Manager of the read/write lock resource.
More...
#include <ReadWriteLock.hh>
|
| baton_type (bool Logging=true) |
| Constructor. More...
|
|
void * | Handle () |
| Return pointer to low level data storage. More...
|
|
void | Lock (mode_type Mode, const char *const File, const size_t Line) |
| Request the resource to be locked. More...
|
|
void | Lock (mode_type Mode, bool TryLock, const char *const File, const size_t Line) |
| Request the resource to be locked. More...
|
|
void | Lock (mode_type Mode, size_t Timeout, const char *const File, const size_t Line) |
| Request the resource to be locked. More...
|
|
void | TryLock (mode_type Mode, const char *const File, const size_t Line) |
| Request the resource to be locked without waiting. More...
|
|
void | Unlock (const char *const File, const size_t Line) |
| Release any locks held on the resource. More...
|
|
void | reset () |
| Destroy the resources associated with this instance. More...
|
|
|
boost::shared_ptr< impl > | p |
|
Manager of the read/write lock resource.
◆ baton_type()
LDASTools::AL::ReadWriteLock::baton_type::baton_type |
( |
bool |
Logging = true | ) |
|
Constructor.
- Parameters
-
[in] | Logging | If true, then all actions associated with this instance will be logged for DeadLockDetector. |
◆ Handle()
void * LDASTools::AL::ReadWriteLock::baton_type::Handle |
( |
| ) |
|
Return pointer to low level data storage.
- Returns
- Pointer to low level data storage.
- Note
- This should be used very sparingly since the library used to implement this fuctionality may change.
◆ Lock() [1/3]
void LDASTools::AL::ReadWriteLock::baton_type::Lock |
( |
mode_type |
Mode, |
|
|
bool |
TryLock, |
|
|
const char *const |
File, |
|
|
const size_t |
Line |
|
) |
| |
Request the resource to be locked.
- Parameters
-
[in] | Mode | Any of the lock_modes. |
[in] | TryLock | If true, then return immediately wether or not the lock was obtained. |
[in] | File | The filename from where the call was made. |
[in] | Line | The line number from where the call was made. |
try {
}
catch( const ReadWrieLock::BusyError& Exception )
{
...
}
catch( const ReadWrieLock::DeadLockError& Exception )
{
...
}
◆ Lock() [2/3]
void LDASTools::AL::ReadWriteLock::baton_type::Lock |
( |
mode_type |
Mode, |
|
|
const char *const |
File, |
|
|
const size_t |
Line |
|
) |
| |
|
inline |
Request the resource to be locked.
- Parameters
-
[in] | Mode | Any of the lock_modes. |
[in] | File | The filename from where the call was made. |
[in] | Line | The line number from where the call was made. |
try {
}
catch( const ReadWriteLock::BusyError& Exception )
{
...
}
catch( const ReadWriteLock::DeadLockError& Exception )
{
...
}
◆ Lock() [3/3]
void LDASTools::AL::ReadWriteLock::baton_type::Lock |
( |
mode_type |
Mode, |
|
|
size_t |
Timeout, |
|
|
const char *const |
File, |
|
|
const size_t |
Line |
|
) |
| |
Request the resource to be locked.
- Parameters
-
[in] | Mode | Any of the lock_modes. |
[in] | Timeout | Time limit in seconds in which to acquire the lock. A value of zero (0) indicates that the method should wait until the lock is granted. |
[in] | File | The filename from where the call was made. |
[in] | Line | The line number from where the call was made. |
◆ reset()
void LDASTools::AL::ReadWriteLock::baton_type::reset |
( |
| ) |
|
|
inline |
Destroy the resources associated with this instance.
◆ TryLock()
void LDASTools::AL::ReadWriteLock::baton_type::TryLock |
( |
mode_type |
Mode, |
|
|
const char *const |
File, |
|
|
const size_t |
Line |
|
) |
| |
|
inline |
Request the resource to be locked without waiting.
- Parameters
-
[in] | Mode | Any of the lock_modes. |
[in] | File | The filename from where the call was made. |
[in] | Line | The line number from where the call was made. |
The TryLock method tries to lock the resouce. If the resouce is locked prior to this call, then the method returns immediately by throwing the ReadWriteLock::BusyError exception.
try {
}
catch( const ReadWriteLock::BusyError& Exception )
{
...
}
catch( const ReadWriteLock::DeadLockError& Exception )
{
...
}
◆ Unlock()
void LDASTools::AL::ReadWriteLock::baton_type::Unlock |
( |
const char *const |
File, |
|
|
const size_t |
Line |
|
) |
| |
Release any locks held on the resource.
- Parameters
-
[in] | File | The filename from where the call was made. |
[in] | Line | The line number from where the call was made. |
◆ ReadWriteLockBatonHandle
boost::shared_ptr< impl > LDASTools::AL::ReadWriteLock::baton_type::p |
|
private |
◆ retry_count_max
int LDASTools::AL::ReadWriteLock::baton_type::retry_count_max = 10 |
|
staticprivate |
The documentation for this class was generated from the following files: