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 Member Functions | |
OsclScopedLock (LockClass &inLock) | |
Default constructor Initializes the pointer and takes ownership. | |
~OsclScopedLock () | |
Destructor. |
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.
OsclScopedLock< LockClass >::OsclScopedLock | ( | LockClass & | inLock | ) | [inline, explicit] |
Default constructor Initializes the pointer and takes ownership.
OsclScopedLock< LockClass >::~OsclScopedLock | ( | ) | [inline] |
Destructor.
The pointer is deleted in case this class still has ownership