This class provides simple critical sections functionality.
Definition at line 31 of file CCriticalSection.h.
#include <mrpt/synch/CCriticalSection.h>
Public Member Functions | |
CCriticalSection (const char *name=NULL) | |
Constructor. More... | |
~CCriticalSection () | |
Destructor. More... | |
void | enter () const |
Enter. More... | |
void | leave () const |
Leave. More... | |
std::string | getName () const |
Returns the name used in the constructor. More... | |
Public Attributes | |
utils::CStream * | m_debugOut |
If set to a non-NULL value, debug messages regarding the calling threads IDs will be output. More... | |
Private Attributes | |
mrpt::utils::CReferencedMemBlock | m_data |
The OS-dependent descriptors. More... | |
std::string | m_name |
mrpt::synch::CCriticalSection::CCriticalSection | ( | const char * | name = NULL | ) |
Constructor.
mrpt::synch::CCriticalSection::~CCriticalSection | ( | ) |
Destructor.
void mrpt::synch::CCriticalSection::enter | ( | ) | const |
Enter.
If | the calling thread already possesses this critical section (it would be a dead-lock). |
Referenced by mrpt::synch::MT_buffer::appendData(), mrpt::synch::MT_buffer::clear(), mrpt::slam::CMetricMapBuilder::enterCriticalSection(), mrpt::utils::CConsoleRedirector::overflow(), mrpt::synch::MT_buffer::read(), mrpt::synch::MT_buffer::readAndClear(), mrpt::synch::MT_buffer::size(), and mrpt::utils::CConsoleRedirector::sync().
|
inline |
Returns the name used in the constructor.
Definition at line 57 of file CCriticalSection.h.
void mrpt::synch::CCriticalSection::leave | ( | ) | const |
Leave.
If | the calling thread is not the current owener of the critical section. |
Referenced by mrpt::synch::MT_buffer::appendData(), mrpt::synch::MT_buffer::clear(), mrpt::slam::CMetricMapBuilder::leaveCriticalSection(), mrpt::utils::CConsoleRedirector::overflow(), mrpt::synch::MT_buffer::read(), mrpt::synch::MT_buffer::readAndClear(), mrpt::synch::MT_buffer::size(), and mrpt::utils::CConsoleRedirector::sync().
|
private |
The OS-dependent descriptors.
Definition at line 34 of file CCriticalSection.h.
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 61 of file CCriticalSection.h.
|
private |
Definition at line 36 of file CCriticalSection.h.
Page generated by Doxygen 1.9.1 for MRPT 1.4.0 SVN: at Mon Apr 18 04:07:33 UTC 2022 |