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

Method LockIfRequired

lib/base/namespace.cpp:136–142  ·  view source on GitHub ↗

* Returns an already locked ObjectLock if the namespace is frozen. * Otherwise, returns an unlocked object lock. * * @returns An object lock. */

Source from the content-addressed store, hash-verified

134 * @returns An object lock.
135 */
136ObjectLock Namespace::LockIfRequired()
137{
138 if (Frozen()) {
139 return ObjectLock(this, std::defer_lock);
140 }
141 return ObjectLock(this);
142}
143
144std::shared_lock<std::shared_timed_mutex> Namespace::ReadLockUnlessFrozen() const
145{

Callers

nothing calls this directly

Calls 1

ObjectLockClass · 0.85

Tested by

no test coverage detected