#include <mrpt/synch/CCriticalSection.h>
Public Member Functions | |
CCriticalSectionLocker (const CCriticalSection *cs) | |
Constructor: enters the critical section. | |
CCriticalSectionLocker (const CCriticalSectionLocker &o) | |
CCriticalSectionLocker & | operator= (const CCriticalSectionLocker &o) |
~CCriticalSectionLocker () | |
Destructor: leaves the critical section. | |
Protected Attributes | |
const CCriticalSection * | m_cs |
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:
{ // Code in this scope is protected by critical section CCriticalSectionLocker myCSLocker( &myCS ); ... } // End of code protected by critical section
Definition at line 91 of file CCriticalSection.h.
mrpt::synch::CCriticalSectionLocker::CCriticalSectionLocker | ( | const CCriticalSection * | cs | ) |
Constructor: enters the critical section.
mrpt::synch::CCriticalSectionLocker::CCriticalSectionLocker | ( | const CCriticalSectionLocker & | o | ) | [inline] |
Definition at line 101 of file CCriticalSection.h.
mrpt::synch::CCriticalSectionLocker::~CCriticalSectionLocker | ( | ) |
Destructor: leaves the critical section.
CCriticalSectionLocker& mrpt::synch::CCriticalSectionLocker::operator= | ( | const CCriticalSectionLocker & | o | ) | [inline] |
const CCriticalSection* mrpt::synch::CCriticalSectionLocker::m_cs [protected] |
Page generated by Doxygen 1.5.7.1 for MRPT 0.6.5 SVN: at Mon Feb 23 13:25:04 EST 2009 |