CS::Threading::ScopedLock< T > Class Template Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

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

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

CS::Threading::ScopedLock< T > Class Template Reference

This is a utility class for locking a Mutex. More...

`#include <csutil/threading/mutex.h>`

List of all members.

## Detailed Description

### template<typename T>
class CS::Threading::ScopedLock< T >

This is a utility class for locking a Mutex.

If a ScopedLock class is created it locks the mutex, when it is destroyed it unlocks the Mutex again. So locking a mutex can happen by creating a ScopedLock object on the stack. The compiler will then take care that the Unlock calls will be done in each case.

       void Myfunc() {
          ScopedLock lock(mymutex);
          do something special

          return;
      }

Definition at line 163 of file mutex.h.

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

- csutil/threading/mutex.h