You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std::lock_guard is a handy type to lock/unlock a mutex automatically according the lifetime of a std::lock_guard instance. It only requires that the provided mutex type satisfy BasicLockable which only requires the existence of a lock() and unlock() member function.
The least intrusive method is to add an alias function:
diff --git a/Os/Mutex.hpp b/Os/Mutex.hpp
index 94ebab234..31934015a 100644
--- a/Os/Mutex.hpp+++ b/Os/Mutex.hpp@@ -14,6 +14,14 @@ namespace Os {
void lock(); //!< lock the mutex
void unLock(); //!< unlock the mutex
+ /**+ * An alias to @ref unLock() that allows the type to satisfy the+ * BasicLockable requirements+ * (https://en.cppreference.com/w/cpp/named_req/BasicLockable)+ * needed to work with @ref std::lock_guard.+ */+ void unlock() { this->unLock(); }+
private:
POINTER_CAST m_handle; //!< Stored handle to mutex
The text was updated successfully, but these errors were encountered:
std::lock_guard
is a handy type to lock/unlock a mutex automatically according the lifetime of astd::lock_guard
instance. It only requires that the provided mutex type satisfy BasicLockable which only requires the existence of alock()
andunlock()
member function.The least intrusive method is to add an alias function:
The text was updated successfully, but these errors were encountered: