diff --git a/include/crucible/lockset.h b/include/crucible/lockset.h index 2af782d..8a3fdf2 100644 --- a/include/crucible/lockset.h +++ b/include/crucible/lockset.h @@ -63,6 +63,7 @@ namespace crucible { bool try_lock(); }; + Lock make_lock(const key_type &name, bool start_locked = true); }; template @@ -215,7 +216,7 @@ namespace crucible { template LockSet::Lock::Lock(Lock &&that) : - m_lockset(that.lockset), + m_lockset(that.m_lockset), m_name(that.m_name), m_locked(that.m_locked) { @@ -236,6 +237,13 @@ namespace crucible { return *this; } + template + typename LockSet::Lock + LockSet::make_lock(const key_type &name, bool start_locked) + { + return Lock(*this, name, start_locked); + } + } #endif // CRUCIBLE_LOCKSET_H