# FoundationClasses
TKernel
Standard

# Standard_Mutex::Sentry Class Reference

Simple sentry class providing convenient interface to mutex. More...

`#include <Standard_Mutex.hxx>`

## Public Member Functions

| Sentry (Standard_Mutex &theMutex)
| Constructor - initializes the sentry object by reference to a mutex (which must be initialized) and locks the mutex immediately.
| ~Sentry ()
| Destructor - unlocks the mutex if already locked.

## Private Attributes

Standard_Mutex & | myMutex

## Detailed Description

Provides automatic locking and unlocking a mutex in its constructor and destructor, thus ensuring correct unlock of the mutex even in case of raising an exception or signal from the protected code.

Create instance of that class when entering critical section.

## Constructor & Destructor Documentation

Standard_Mutex::Sentry::Sentry | ( | Standard_Mutex & | theMutex | ) | `[inline]`

Standard_Mutex::Sentry::~Sentry | ( |  | ) | `[inline]`

## Field Documentation

Standard_Mutex& Standard_Mutex::Sentry::myMutex `[private]`

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

- Standard_Mutex.hxx