Implements read/write lock symantics.
More...
#include <ReadWriteLock.hh>
|
enum | lock_mode {
NONE = 0x0000,
READ = 0x0001,
WRITE = 0x0002,
NONE = 0x0000,
READ = 0x0001,
WRITE = 0x0002
} |
| Lock mode. More...
|
|
enum | lock_state {
STATE_NONE = 0x0000,
PENDING = 0x0001,
ACTIVE = 0x0002,
STATE_NONE = 0x0000,
PENDING = 0x0001,
ACTIVE = 0x0002
} |
| Lock state. More...
|
|
enum | lock_mode {
NONE = 0x0000,
READ = 0x0001,
WRITE = 0x0002,
NONE = 0x0000,
READ = 0x0001,
WRITE = 0x0002
} |
| Lock mode. More...
|
|
enum | lock_state {
STATE_NONE = 0x0000,
PENDING = 0x0001,
ACTIVE = 0x0002,
STATE_NONE = 0x0000,
PENDING = 0x0001,
ACTIVE = 0x0002
} |
| Lock state. More...
|
|
typedef enum LDASTools::AL::ReadWriteLock::lock_mode | mode_type |
| Lock mode. More...
|
|
typedef enum LDASTools::AL::ReadWriteLock::lock_mode | mode_type |
| Lock mode. More...
|
|
|
| ReadWriteLock (baton_type Lock, mode_type Mode, const char *Filename, int Linenum) |
| Constructor. More...
|
|
| ReadWriteLock (baton_type Lock, mode_type Mode, bool TryLock, const char *Filename, int Linenum) |
| Constructor. More...
|
|
| ReadWriteLock (baton_type Lock, mode_type Mode, int Timeout, const char *Filename, int Linenum) |
| Constructor. More...
|
|
virtual | ~ReadWriteLock () |
| Destructor. More...
|
|
void | Modify (mode_type Mode, const char *Filename, int Linenum) |
| Modify the mode of lock being held on the resource. More...
|
|
void | Release (const char *Filename, int Linenum) |
| Release the lock. More...
|
|
| ReadWriteLock (baton_type Lock, mode_type Mode, const char *Filename, int Linenum) |
| Constructor. More...
|
|
| ReadWriteLock (baton_type Lock, mode_type Mode, bool TryLock, const char *Filename, int Linenum) |
| Constructor. More...
|
|
| ReadWriteLock (baton_type Lock, mode_type Mode, int Timeout, const char *Filename, int Linenum) |
| Constructor. More...
|
|
virtual | ~ReadWriteLock () |
| Destructor. More...
|
|
void | Modify (mode_type Mode, const char *Filename, int Linenum) |
| Modify the mode of lock being held on the resource. More...
|
|
void | Release (const char *Filename, int Linenum) |
| Release the lock. More...
|
|
Implements read/write lock symantics.
This class provides proper garbage collection of system resource used to implement thread safe read/write locks.
ReadWriteLock::baton_type
baton;
void
threaded_func()
{
__FILE__, __LINE__ );
...
}
◆ mode_type [1/2]
◆ mode_type [2/2]
◆ lock_mode [1/2]
Lock mode.
Enumerator |
---|
NONE | |
READ | < Initial mode
|
WRITE | < Read lock allows multiple concurrent reads.
|
NONE | |
READ | < Initial mode
|
WRITE | < Read lock allows multiple concurrent reads.
|
◆ lock_mode [2/2]
Lock mode.
Enumerator |
---|
NONE | |
READ | < Initial mode
|
WRITE | < Read lock allows multiple concurrent reads.
|
NONE | |
READ | < Initial mode
|
WRITE | < Read lock allows multiple concurrent reads.
|
◆ lock_state [1/2]
Lock state.
Enumerator |
---|
STATE_NONE | |
PENDING | < Initial state
|
ACTIVE | < Lock requested
|
STATE_NONE | |
PENDING | < Initial state
|
ACTIVE | < Lock requested
|
◆ lock_state [2/2]
Lock state.
Enumerator |
---|
STATE_NONE | |
PENDING | < Initial state
|
ACTIVE | < Lock requested
|
STATE_NONE | |
PENDING | < Initial state
|
ACTIVE | < Lock requested
|
◆ ReadWriteLock() [1/6]
LDASTools::AL::ReadWriteLock::ReadWriteLock |
( |
baton_type |
Lock, |
|
|
mode_type |
Mode, |
|
|
const char * |
Filename, |
|
|
int |
Linenum |
|
) |
| |
Constructor.
- Parameters
-
[in] | Lock | Baton controlling access to the resource. |
[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. |
◆ ReadWriteLock() [2/6]
LDASTools::AL::ReadWriteLock::ReadWriteLock |
( |
baton_type |
Lock, |
|
|
mode_type |
Mode, |
|
|
bool |
TryLock, |
|
|
const char * |
Filename, |
|
|
int |
Linenum |
|
) |
| |
Constructor.
- Parameters
-
[in] | Lock | Baton controlling access to the resource. |
[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. |
◆ ReadWriteLock() [3/6]
LDASTools::AL::ReadWriteLock::ReadWriteLock |
( |
baton_type |
Lock, |
|
|
mode_type |
Mode, |
|
|
int |
Timeout, |
|
|
const char * |
Filename, |
|
|
int |
Linenum |
|
) |
| |
Constructor.
- Parameters
-
[in] | Lock | Baton controlling access to the resource. |
[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. |
◆ ~ReadWriteLock() [1/2]
LDASTools::AL::ReadWriteLock::~ReadWriteLock |
( |
| ) |
|
|
virtual |
◆ ReadWriteLock() [4/6]
LDASTools::AL::ReadWriteLock::ReadWriteLock |
( |
baton_type |
Lock, |
|
|
mode_type |
Mode, |
|
|
const char * |
Filename, |
|
|
int |
Linenum |
|
) |
| |
Constructor.
- Parameters
-
[in] | Lock | Baton controlling access to the resource. |
[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. |
◆ ReadWriteLock() [5/6]
LDASTools::AL::ReadWriteLock::ReadWriteLock |
( |
baton_type |
Lock, |
|
|
mode_type |
Mode, |
|
|
bool |
TryLock, |
|
|
const char * |
Filename, |
|
|
int |
Linenum |
|
) |
| |
Constructor.
- Parameters
-
[in] | Lock | Baton controlling access to the resource. |
[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. |
◆ ReadWriteLock() [6/6]
LDASTools::AL::ReadWriteLock::ReadWriteLock |
( |
baton_type |
Lock, |
|
|
mode_type |
Mode, |
|
|
int |
Timeout, |
|
|
const char * |
Filename, |
|
|
int |
Linenum |
|
) |
| |
Constructor.
- Parameters
-
[in] | Lock | Baton controlling access to the resource. |
[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. |
◆ ~ReadWriteLock() [2/2]
virtual LDASTools::AL::ReadWriteLock::~ReadWriteLock |
( |
| ) |
|
|
virtual |
◆ Baton() [1/2]
Create a baton that is appropriate for use with this class.
◆ Baton() [2/2]
static baton_type LDASTools::AL::ReadWriteLock::Baton |
( |
| ) |
|
|
static |
Create a baton that is appropriate for use with this class.
◆ Interval() [1/2]
int LDASTools::AL::ReadWriteLock::Interval |
( |
int |
Value | ) |
|
|
static |
◆ Interval() [2/2]
static int LDASTools::AL::ReadWriteLock::Interval |
( |
int |
Value | ) |
|
|
static |
◆ Modify() [1/2]
void LDASTools::AL::ReadWriteLock::Modify |
( |
mode_type |
Mode, |
|
|
const char * |
Filename, |
|
|
int |
Linenum |
|
) |
| |
Modify the mode of lock being held on the resource.
- Parameters
-
[in] | Mode | The new mode to be held on the resource. |
[in] | File | The filename from where the call was made. |
[in] | Line | The line number from where the call was made. |
◆ Modify() [2/2]
void LDASTools::AL::ReadWriteLock::Modify |
( |
mode_type |
Mode, |
|
|
const char * |
Filename, |
|
|
int |
Linenum |
|
) |
| |
Modify the mode of lock being held on the resource.
- Parameters
-
[in] | Mode | The new mode to be held on the resource. |
[in] | File | The filename from where the call was made. |
[in] | Line | The line number from where the call was made. |
◆ Release() [1/2]
void LDASTools::AL::ReadWriteLock::Release |
( |
const char * |
Filename, |
|
|
int |
Linenum |
|
) |
| |
Release the lock.
- Parameters
-
[in] | File | The filename from where the call was made. |
[in] | Line | The line number from where the call was made. |
◆ Release() [2/2]
void LDASTools::AL::ReadWriteLock::Release |
( |
const char * |
Filename, |
|
|
int |
Linenum |
|
) |
| |
Release the lock.
- Parameters
-
[in] | File | The filename from where the call was made. |
[in] | Line | The line number from where the call was made. |
◆ ThreadCancel() [1/2]
static void LDASTools::AL::ReadWriteLock::ThreadCancel |
( |
void * |
VLock | ) |
|
|
static |
Handler for thead cancelation.
- Parameters
-
[in] | VLock | The VLock is a pointer to a ReadWriteLock object that holds a lock. |
◆ ThreadCancel() [2/2]
static void LDASTools::AL::ReadWriteLock::ThreadCancel |
( |
void * |
VLock | ) |
|
|
static |
Handler for thead cancelation.
- Parameters
-
[in] | VLock | The VLock is a pointer to a ReadWriteLock object that holds a lock. |
◆ Timeout() [1/2]
int LDASTools::AL::ReadWriteLock::Timeout |
( |
int |
Value | ) |
|
|
static |
◆ Timeout() [2/2]
static int LDASTools::AL::ReadWriteLock::Timeout |
( |
int |
Value | ) |
|
|
static |
◆ sync_baton
baton_type LDASTools::AL::ReadWriteLock::sync_baton |
|
private |
The documentation for this class was generated from the following files: