Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# OsclScopedLock< LockClass > Class Template Reference
[OSCL Base]

The OsclScopedLock class is a template class that handles unlocking an abstract class on destruction. This is very useful for ensuring that the lock is released when the OsclScopedLock goes out of scope. More...

`#include <oscl_lock_base.h>`

## Public Methods
| OsclScopedLock (LockClass &inLock)
| Default constructor Initializes the pointer and takes ownership.
| ~OsclScopedLock ()
| Destructor.

## Detailed Description

### template<class LockClass>
class OsclScopedLock< LockClass >

The OsclScopedLock class is a template class that handles unlocking an abstract class on destruction. This is very useful for ensuring that the lock is released when the OsclScopedLock goes out of scope.

The purpose of this class is to provide a way to prevent accidental resource leaks in a class or a method, due to "not remembering to unlock" variables which might lead to deadlock conditions.

## Constructor & Destructor Documentation

template<class LockClass>
OsclScopedLock< LockClass >::OsclScopedLock | ( | LockClass & | inLock | ) | `[inline, explicit]`

| Default constructor Initializes the pointer and takes ownership.

template<class LockClass>
OsclScopedLock< LockClass >::~OsclScopedLock | ( |  | ) | `[inline]`

| Destructor. The pointer is deleted in case this class still has ownership

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

- oscl_lock_base.h