Main MRPT website > C++ reference for MRPT 1.5.6
List of all members | Public Member Functions | Public Attributes | Private Attributes
mrpt::synch::CCriticalSection Class Reference

Detailed Description

This class provides simple critical sections functionality.

See Also
CCriticalSectionLocker

Definition at line 41 of file CCriticalSection.h.

#include <mrpt/synch/CCriticalSection.h>

Inheritance diagram for mrpt::synch::CCriticalSection:
Inheritance graph

Public Member Functions

 CCriticalSection (const char *name=NULL)
 Ctor. More...
 
virtual ~CCriticalSection ()
 Dtor. More...
 
void enter () const MRPT_OVERRIDE
 Enter.

Exceptions
Ifthe calling thread already possesses this critical section (it would be a dead-lock).
More...
 
void leave () const MRPT_OVERRIDE
 Leave.

Exceptions
Ifthe calling thread is not the current owner of the critical section.
More...
 
bool try_enter () const MRPT_OVERRIDE
 Returns true if adquired; false otherwise. More...
 
std::string getName () const
 Returns the name used in the constructor. More...
 

Public Attributes

utils::CStreamm_debugOut
 If set to a non-NULL value, debug messages regarding the calling threads IDs will be output. More...
 

Private Attributes

voidm_data
 std::mutex*. Opaque ptr until MRPT 2.0.0 in which we could expose C++11 to user headers More...
 
std::string m_name
 

Constructor & Destructor Documentation

CCriticalSection::CCriticalSection ( const char *  name = NULL)

Ctor.

Definition at line 25 of file CCriticalSection.cpp.

CCriticalSection::~CCriticalSection ( )
virtual

Dtor.

Definition at line 32 of file CCriticalSection.cpp.

References m_data.

Member Function Documentation

void CCriticalSection::enter ( ) const
virtual
std::string mrpt::synch::CCriticalSection::getName ( ) const
inline

Returns the name used in the constructor.

Definition at line 55 of file CCriticalSection.h.

void CCriticalSection::leave ( ) const
virtual
bool CCriticalSection::try_enter ( ) const
virtual

Returns true if adquired; false otherwise.

Implements mrpt::synch::CAbstractMutex.

Definition at line 59 of file CCriticalSection.cpp.

References m_data.

Member Data Documentation

void* mrpt::synch::CCriticalSection::m_data
private

std::mutex*. Opaque ptr until MRPT 2.0.0 in which we could expose C++11 to user headers

Definition at line 44 of file CCriticalSection.h.

Referenced by enter(), leave(), try_enter(), and ~CCriticalSection().

utils::CStream* mrpt::synch::CCriticalSection::m_debugOut

If set to a non-NULL value, debug messages regarding the calling threads IDs will be output.

Definition at line 58 of file CCriticalSection.h.

Referenced by enter(), and leave().

std::string mrpt::synch::CCriticalSection::m_name
private

Definition at line 45 of file CCriticalSection.h.

Referenced by enter(), and leave().




Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018