MCPcopy Create free account
hub / github.com/Icinga/icinga2 / ObjectLock

Class ObjectLock

lib/base/objectlock.hpp:15–36  ·  view source on GitHub ↗

* A scoped lock for Objects. */

Source from the content-addressed store, hash-verified

13 * A scoped lock for Objects.
14 */
15struct ObjectLock
16{
17public:
18 ObjectLock(const Object::Ptr& object);
19 ObjectLock(const Object::Ptr& object, std::defer_lock_t);
20 ObjectLock(const Object *object);
21
22 ObjectLock(const ObjectLock&) = delete;
23 ObjectLock& operator=(const ObjectLock&) = delete;
24
25 ~ObjectLock();
26
27 bool TryLock() noexcept;
28 void Lock();
29 void Unlock();
30
31 operator bool() const;
32
33private:
34 const Object *m_Object{nullptr};
35 bool m_Locked{false};
36};
37
38}
39

Callers 3

LockIfRequiredMethod · 0.85
LockIfRequiredMethod · 0.85
LockIfRequiredMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected