Add steal to lockable
This commit is contained in:
parent
81e71dd452
commit
a5a79e2d38
|
@ -12,6 +12,9 @@ namespace Feather
|
|||
auto borrow() { return std::pair< T&, std::lock_guard<std::mutex>>{object, mutex}; }
|
||||
auto borrow() const { return std::pair<const T&, std::lock_guard<std::mutex>>{object, mutex}; }
|
||||
|
||||
T& steal() { return object; }
|
||||
const T& steal() const { return object; }
|
||||
|
||||
private:
|
||||
T object;
|
||||
mutable std::mutex mutex;
|
||||
|
|
Loading…
Reference in New Issue