9 #ifndef mrpt_synch_criticalsection_H
10 #define mrpt_synch_criticalsection_H
18 namespace utils {
class CStream; }
55 std::
string getName()
const {
return m_name; }
124 #define THREADSAFE_OPERATION(_CRITSECT_OBJ, CODE_TO_EXECUTE ) \
126 mrpt::synch::CCriticalSectionLocker lock(&_CRITSECT_OBJ); \
virtual bool try_enter() const =0
Returns true if adquired; false otherwise.
virtual void leave() const =0
virtual void enter() const =0
This class provides simple critical sections functionality.
void * m_data
std::mutex*. Opaque ptr until MRPT 2.0.0 in which we could expose C++11 to user headers
utils::CStream * m_debugOut
If set to a non-NULL value, debug messages regarding the calling threads IDs will be output.
A class acquiring a CCriticalSection at its constructor, and releasing it at destructor.
const CAbstractMutex * m_cs
CCriticalSectionLocker(const CCriticalSectionLocker &o)
Recursive mutex: allow recursive locks by the owner thread.
void * m_data
std::recursive_mutex*. Opaque ptr until MRPT 2.0.0 in which we could expose C++11 to user headers
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
GLuint const GLchar * name
GLsizei const GLchar ** string
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.