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);
44 std::mutex *mut =
reinterpret_cast<std::mutex*
>(
m_data);
55 std::mutex *mut =
reinterpret_cast<std::mutex*
>(
m_data);
61 std::mutex *mut =
reinterpret_cast<std::mutex*
>(
m_data);
62 return mut->try_lock();
67 m_data( new std::recursive_mutex() )
72 std::recursive_mutex *mut =
reinterpret_cast<std::recursive_mutex*
>(
m_data);
79 std::recursive_mutex *mut =
reinterpret_cast<std::recursive_mutex*
>(
m_data);
85 std::recursive_mutex *mut =
reinterpret_cast<std::recursive_mutex*
>(
m_data);
91 std::recursive_mutex *mut =
reinterpret_cast<std::recursive_mutex*
>(
m_data);
92 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
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
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,...