ldas-tools-al
2.6.6
|
Descibes an object which release a mutex lock. More...
#include <mutexlock.hh>
Classes | |
class | baton_type |
class | BusyError |
Alias for the system specific mutex type. More... | |
Public Member Functions | |
MutexLock (baton_type Baton, const char *const File, const unsigned int Line) | |
Constructor. More... | |
~MutexLock () | |
Destructor. More... | |
void | Release (const char *const File, const unsigned int Line) |
Release the lock before object is destructed. More... | |
MutexLock (baton_type Baton, const char *const File, const unsigned int Line) | |
Constructor. More... | |
~MutexLock () | |
Destructor. More... | |
void | Release (const char *const File, const unsigned int Line) |
Release the lock before object is destructed. More... | |
MutexLock (baton_type Baton, const char *const File, const unsigned int Line) | |
Constructor. More... | |
~MutexLock () | |
Destructor. More... | |
void | Release (const char *const File, const unsigned int Line) |
Release the lock before object is destructed. More... | |
Static Public Member Functions | |
static baton_type | Baton () |
Create a baton that is appropriate for use with this class. More... | |
static void | ThreadCancel (void *VLock, const char *File=__FILE__, const unsigned int Line=__LINE__) |
Handler for thead cancelation. More... | |
static baton_type | Baton () |
Create a baton that is appropriate for use with this class. More... | |
static void | ThreadCancel (void *VLock, const char *File=__FILE__, const unsigned int Line=__LINE__) |
Handler for thead cancelation. More... | |
static baton_type | Baton () |
Create a baton that is appropriate for use with this class. More... | |
static void | ThreadCancel (void *VLock, const char *File=__FILE__, const unsigned int Line=__LINE__) |
Handler for thead cancelation. More... | |
Private Member Functions | |
MutexLock () | |
Default Constructor. More... | |
MutexLock (const MutexLock &) | |
Copy Constructor. More... | |
const MutexLock & | operator= (const MutexLock &) |
Assigment operator. More... | |
MutexLock () | |
Default Constructor. More... | |
MutexLock (const MutexLock &) | |
Copy Constructor. More... | |
const MutexLock & | operator= (const MutexLock &) |
Assigment operator. More... | |
MutexLock () | |
Default Constructor. More... | |
MutexLock (const MutexLock &) | |
Copy Constructor. More... | |
const MutexLock & | operator= (const MutexLock &) |
Assigment operator. More... | |
Private Attributes | |
baton_type | baton |
Object to prevent multiple access to critical sections of code. More... | |
bool | m_logging |
Keeps track of logging state. More... | |
Descibes an object which release a mutex lock.
This class ensures that the given mutex is unlocked whenever an exception is thrown but not caught in a locked section.
It should be used like this:
Creating two MutexLock objects with the same mutex in the same scope will cause a deadlock.
LDASTools::AL::MutexLock::MutexLock | ( | baton_type | Baton, |
const char *const | File, | ||
const unsigned int | Line | ||
) |
Constructor.
Baton | The object to provide lock syncronization. |
File | The from where the request was made. |
Line | The line number from where the request was made. |
This contructor creates an object to ensure the releasing of the exclusive lock once the object goes out of scope. The lock held by the object can be released early by calling the Release method.
LDASTools::AL::MutexLock::~MutexLock | ( | ) |
Destructor.
|
private |
Default Constructor.
Default constructor is private to prevent copying of classes internal data.
|
private |
Copy Constructor.
Copy constructor is private to prevent copying of classes internal data.
LDASTools::AL::MutexLock::MutexLock | ( | baton_type | Baton, |
const char *const | File, | ||
const unsigned int | Line | ||
) |
Constructor.
Baton | The object to provide lock syncronization. |
File | The from where the request was made. |
Line | The line number from where the request was made. |
LDASTools::AL::MutexLock::~MutexLock | ( | ) |
Destructor.
|
private |
Default Constructor.
Default constructor is private to prevent copying of classes internal data.
|
private |
Copy Constructor.
Copy constructor is private to prevent copying of classes internal data.
LDASTools::AL::MutexLock::MutexLock | ( | baton_type | Baton, |
const char *const | File, | ||
const unsigned int | Line | ||
) |
Constructor.
Baton | The object to provide lock syncronization. |
File | The from where the request was made. |
Line | The line number from where the request was made. |
LDASTools::AL::MutexLock::~MutexLock | ( | ) |
Destructor.
|
private |
Default Constructor.
Default constructor is private to prevent copying of classes internal data.
|
private |
Copy Constructor.
Copy constructor is private to prevent copying of classes internal data.
|
static |
Create a baton that is appropriate for use with this class.
|
static |
Create a baton that is appropriate for use with this class.
|
static |
Create a baton that is appropriate for use with this class.
Assigment operator.
Assignment operator is privat to prevent copying of classes internal data
Assigment operator.
Assignment operator is privat to prevent copying of classes internal data
Assigment operator.
Assignment operator is privat to prevent copying of classes internal data
void LDASTools::AL::MutexLock::Release | ( | const char *const | File, |
const unsigned int | Line | ||
) |
Release the lock before object is destructed.
void LDASTools::AL::MutexLock::Release | ( | const char *const | File, |
const unsigned int | Line | ||
) |
Release the lock before object is destructed.
void LDASTools::AL::MutexLock::Release | ( | const char *const | File, |
const unsigned int | Line | ||
) |
Release the lock before object is destructed.
|
static |
Handler for thead cancelation.
[in] | VLock | The VLock is a pointer to a ReadWriteLock object that holds a lock. |
[in] | File | The file where the request was made. |
[in] | Line | The line number from where the request was made. |
This routine is used when a thread is canceled and the lock needs to be release. It is currently only written to support pthread_cancel_push().
|
static |
Handler for thead cancelation.
[in] | VLock | The VLock is a pointer to a ReadWriteLock object that holds a lock. |
[in] | File | The file where the request was made. |
[in] | Line | The line number from where the request was made. |
|
static |
Handler for thead cancelation.
[in] | VLock | The VLock is a pointer to a ReadWriteLock object that holds a lock. |
[in] | File | The file where the request was made. |
[in] | Line | The line number from where the request was made. |
|
private |
Object to prevent multiple access to critical sections of code.
|
private |
Keeps track of logging state.