made lockable work in const context

This commit is contained in:
Dominik Tomičević 2015-11-08 19:05:34 +01:00
parent 30257da8fd
commit 7bccf5c995

View File

@ -10,17 +10,17 @@ class Lockable
public:
using lock_type = lock_t;
std::lock_guard<lock_t> acquire_guard()
std::lock_guard<lock_t> acquire_guard() const
{
return std::lock_guard<lock_t>(lock);
}
std::unique_lock<lock_t> acquire_unique()
std::unique_lock<lock_t> acquire_unique() const
{
return std::unique_lock<lock_t>(lock);
}
lock_t lock;
mutable lock_t lock;
};
#endif