## Public API Reference

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

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# csScopedMutexLock Class Reference

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

`#include <csutil/scopedmutexlock.h>`

List of all members.

## Public Member Functions

| csScopedMutexLock (csMutex *newmutex)
| ~csScopedMutexLock ()

## Public Attributes

csMutex * | mutex

## Detailed Description

This is a utility class for locking a Mutex.

If A MutexLock 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 MutexLock object on the stack. The compiler will then take care that the Unlock calls will be done in each case.

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

          return;
      }

Definition at line 44 of file scopedmutexlock.h.

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

- csutil/scopedmutexlock.h