ldas-tools-al
2.6.7
|
Descibes an object which release a mutex lock. More...
#include <mutexlock.hh>
Classes | |
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. | |
void | Release (const char *const File, const unsigned int Line) |
Release the lock before object is destructed. | |
MutexLock (baton_type Baton, const char *const File, const unsigned int Line) | |
Constructor. More... | |
~MutexLock () | |
Destructor. | |
void | Release (const char *const File, const unsigned int Line) |
Release the lock before object is destructed. | |
MutexLock (baton_type Baton, const char *const File, const unsigned int Line) | |
Constructor. More... | |
~MutexLock () | |
Destructor. | |
void | Release (const char *const File, const unsigned int Line) |
Release the lock before object is destructed. | |
Static Public Member Functions | |
static baton_type | Baton () |
Create a baton that is appropriate for use with this class. | |
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. | |
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. | |
static void | ThreadCancel (void *VLock, const char *File=__FILE__, const unsigned int Line=__LINE__) |
Handler for thead cancelation. 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 | ( | 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 | ( | 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. |
|
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. |