20 CAbstractMutex::~CAbstractMutex()
25 CCriticalSection::CCriticalSection(
const char *
name) :
26 m_data(new std::mutex()),
34 std::mutex *mut =
reinterpret_cast<std::mutex*
>(
m_data);
49 std::mutex *mut =
reinterpret_cast<std::mutex*
>(
m_data);
60 std::mutex *mut =
reinterpret_cast<std::mutex*
>(
m_data);
66 std::mutex *mut =
reinterpret_cast<std::mutex*
>(
m_data);
67 return mut->try_lock();
72 m_data( new std::recursive_mutex() )
77 std::recursive_mutex *mut =
reinterpret_cast<std::recursive_mutex*
>(
m_data);
84 std::recursive_mutex *mut =
reinterpret_cast<std::recursive_mutex*
>(
m_data);
90 std::recursive_mutex *mut =
reinterpret_cast<std::recursive_mutex*
>(
m_data);
96 std::recursive_mutex *mut =
reinterpret_cast<std::recursive_mutex*
>(
m_data);
97 return mut->try_lock();
void enter() const MRPT_OVERRIDE
Enter.
void * m_data
std::mutex*. Opaque ptr until MRPT 2.0.0 in which we could expose C++11 to user headers
std::string getName() const
Returns the name used in the constructor.
void leave() const MRPT_OVERRIDE
Leave.
virtual ~CCriticalSection()
Dtor.
utils::CStream * m_debugOut
If set to a non-NULL value, debug messages regarding the calling threads IDs will be output.
bool try_enter() const MRPT_OVERRIDE
Returns true if adquired; false otherwise.
void leave() const MRPT_OVERRIDE
Leave.
void * m_data
std::recursive_mutex*. Opaque ptr until MRPT 2.0.0 in which we could expose C++11 to user headers
CCriticalSectionRecursive()
void enter() const MRPT_OVERRIDE
Enter.
virtual ~CCriticalSectionRecursive()
bool try_enter() const MRPT_OVERRIDE
Returns true if adquired; false otherwise.
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.
GLuint const GLchar * name
GLsizei const GLchar ** string
unsigned long BASE_IMPEXP getCurrentThreadId() MRPT_NO_THROWS
Returns the ID of the current thread.
This namespace provides multitask, synchronization utilities.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values,...