24 template<
class FromLock,
class ToLock>
37 assert(_lock,
"Lock has been released");
39 _toLock = move(*_lock);
44 assert(_lock,
"Lock has been released");
46 *_lock = move(_toLock);
49 bool owns()
const {
return _lock && _toLock.owns(); }
50 explicit operator bool()
const {
return owns(); }
54 assert(_lock,
"Lock has been released");
55 return _toLock.mutex();
60 Lockable& ret =
mutex();
bool owns() const
Definition: Transfer.h:49
Scoped transfer of mutex ownership between two locks.
Definition: Transfer.h:25
Inherit to declare that class is not copyable.
Definition: Meta.h:286
TransferLock(FromLock &lock)
Transfer ownership of mutex from lock to an instance of ToLock.
Definition: Transfer.h:31
Lockable & release()
Definition: Transfer.h:58
~TransferLock()
Definition: Transfer.h:33
ToLock::Lockable Lockable
Definition: Transfer.h:28
#define assert(...)
Forwards to assert_#args. See assert_1(), assert_2().
Definition: Debug.h:24
Lockable & mutex()
Definition: Transfer.h:52
void unlock()
Definition: Transfer.h:42
void lock()
Definition: Transfer.h:35
Global Honeycomb namespace.