Public Member Functions

atscppapi::ScopedMutexLock Class Reference

Take a Mutex reference and lock inside a scope and unlock when the scope is exited. More...

#include <Mutex.h>

Inherits atscppapi::noncopyable.

Collaboration diagram for atscppapi::ScopedMutexLock:
Collaboration graph
[legend]

Public Member Functions

 ScopedMutexLock (Mutex &mutex)
 Create the scoped mutex lock, once this object is constructed the lock will be held by the thread.
 ~ScopedMutexLock ()
 Unlock the mutex.

Detailed Description

Take a Mutex reference and lock inside a scope and unlock when the scope is exited.

This is an RAII implementation which will lock a mutex at the start of the scope and unlock it when the scope is exited.

See also:
Mutex

Definition at line 119 of file Mutex.h.


Constructor & Destructor Documentation

atscppapi::ScopedMutexLock::ScopedMutexLock ( Mutex mutex  )  [inline, explicit]

Create the scoped mutex lock, once this object is constructed the lock will be held by the thread.

Parameters:
mutex a reference to a Mutex.

Definition at line 125 of file Mutex.h.

References atscppapi::Mutex::lock().

atscppapi::ScopedMutexLock::~ScopedMutexLock (  )  [inline]

Unlock the mutex.

Definition at line 133 of file Mutex.h.

References atscppapi::Mutex::unlock().


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