mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
Allow to defer lock on ObjectLock
This commit is contained in:
parent
455d6fcde1
commit
4c0628c24d
@ -18,6 +18,18 @@ ObjectLock::ObjectLock(const Object::Ptr& object)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a lock for the given object without locking it immediately.
|
||||||
|
*
|
||||||
|
* The user must call Lock() explicitly when needed.
|
||||||
|
*
|
||||||
|
* @param object The object to lock.
|
||||||
|
*/
|
||||||
|
ObjectLock::ObjectLock(const Object::Ptr& object, std::defer_lock_t)
|
||||||
|
: m_Object(object.get()), m_Locked(false)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
ObjectLock::ObjectLock(const Object *object)
|
ObjectLock::ObjectLock(const Object *object)
|
||||||
: m_Object(object), m_Locked(false)
|
: m_Object(object), m_Locked(false)
|
||||||
{
|
{
|
||||||
|
@ -15,6 +15,7 @@ struct ObjectLock
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ObjectLock(const Object::Ptr& object);
|
ObjectLock(const Object::Ptr& object);
|
||||||
|
ObjectLock(const Object::Ptr& object, std::defer_lock_t);
|
||||||
ObjectLock(const Object *object);
|
ObjectLock(const Object *object);
|
||||||
|
|
||||||
ObjectLock(const ObjectLock&) = delete;
|
ObjectLock(const ObjectLock&) = delete;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user