A class acquiring a CCriticalSection at its constructor, and releasing it at destructor.
It is a better idea to always use CCriticalSectionLocker, since it is more secure in the case of possible exceptions, many different exit points from a function, etc.. : it will always release the critical section at the destructor. Example:
Definition at line 90 of file CCriticalSection.h.
#include <mrpt/synch/CCriticalSection.h>
Public Member Functions | |
CCriticalSectionLocker (const CAbstractMutex *cs) | |
Constructor: enters the critical section. More... | |
CCriticalSectionLocker (const CCriticalSectionLocker &o) | |
~CCriticalSectionLocker () | |
Destructor: leaves the critical section. More... | |
Protected Attributes | |
const CAbstractMutex * | m_cs |
mrpt::synch::CCriticalSectionLocker::CCriticalSectionLocker | ( | const CAbstractMutex * | cs | ) |
Constructor: enters the critical section.
|
inline |
Definition at line 101 of file CCriticalSection.h.
mrpt::synch::CCriticalSectionLocker::~CCriticalSectionLocker | ( | ) |
Destructor: leaves the critical section.
|
protected |
Definition at line 93 of file CCriticalSection.h.
Page generated by Doxygen 1.8.13 for MRPT 1.5.3 at Tue Aug 22 01:03:35 UTC 2017 |