| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
SPL::slcThreadLock Class Reference

Thread safe utility class. More...

`#include <spl_threadlock.h>`

List of all members.

## Public Member Functions

SPL_API | slcThreadLock (slcMutex *a_pMutex, bool a_bLock=false)
| Initialisation constructor.
virtual SPL_API | ~slcThreadLock (void)
| Default destructor.
virtual void SPL_API | Lock (void)
| Locks a section - If section is already busy then block and wait until it's ready again.
virtual long SPL_API | TryLock (void)
| Locks a section - If section is busy, return without blocking.
virtual void SPL_API | Unlock (void)
| Unlocks a section.

## Detailed Description

Thread safe utility class.

## Constructor & Destructor Documentation

slcThreadLock::slcThreadLock | ( | slcMutex * | a_pMutex,
|  | bool | a_bLock = `false`
| ) |  |

Initialisation constructor.

Parameters:

  a_pMutex | [in] Pointer to a slcMutex object for locking (usually "this").
  a_bLock | [in] Flag to lock automatically for implicitly or explicitly usage.

slcThreadLock::~slcThreadLock | ( | void |  | ) | `[virtual]`

Default destructor.

Remarks:
  Clears all open (forgotten) locks for deadlock safety.

## Member Function Documentation

void slcThreadLock::Lock | ( | void |  | ) | `[virtual]`

Locks a section - If section is already busy then block and wait until it's ready again.

long slcThreadLock::TryLock | ( | void |  | ) | `[virtual]`

Locks a section - If section is busy, return without blocking.

Returns:
  The method returns one of the following values:

Return values:

  EBUSY | | Section is still locked from another caller.
  0 | | Section is now locked by current call.

< Lock success?

< Incrase lock counter

void slcThreadLock::Unlock | ( | void |  | ) | `[virtual]`

Unlocks a section.

The documentation for this class was generated from the following files:

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/libspl/include/spl_threadlock.h
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/libspl/source/spl_threadlock.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines