aboutsummaryrefslogtreecommitdiffstats
path: root/metrics/src/vespa/metrics/updatehook.cpp
blob: 4282cc98fb25902bc62d1880b2d4c2442b2fa0a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "updatehook.h"

namespace metrics {

MetricLockGuard::MetricLockGuard(std::mutex & mutex)
    : _guard(mutex)
{}

bool
MetricLockGuard::owns(const std::mutex & mutex) const {
    return (_guard.mutex() == &mutex) && _guard.owns_lock();
}

MetricLockGuard::~MetricLockGuard() = default;

}