Kea
2.7.5
unlock_guard.h
Go to the documentation of this file.
1
// Copyright (C) 2020 Internet Systems Consortium, Inc. ("ISC")
2
//
3
// This Source Code Form is subject to the terms of the Mozilla Public
4
// License, v. 2.0. If a copy of the MPL was not distributed with this
5
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7
#ifndef UNLOCK_GUARD_H
8
#define UNLOCK_GUARD_H
9
10
#include <boost/noncopyable.hpp>
11
12
namespace
isc
{
13
namespace
util {
14
20
template
<
typename
Mutex>
21
class
UnlockGuard
:
public
boost::noncopyable {
22
public
:
28
explicit
UnlockGuard
(Mutex& lock) : lock_(lock) {
29
lock_.unlock();
30
}
31
35
~UnlockGuard
() {
36
lock_.lock();
37
}
38
39
private
:
41
Mutex& lock_;
42
};
43
44
}
// namespace util
45
}
// namespace isc
46
47
#endif
// UNLOCK_GUARD_H
isc::util::UnlockGuard
Unlock Guard.
Definition
unlock_guard.h:21
isc::util::UnlockGuard::~UnlockGuard
~UnlockGuard()
Destructor.
Definition
unlock_guard.h:35
isc::util::UnlockGuard::UnlockGuard
UnlockGuard(Mutex &lock)
Constructor.
Definition
unlock_guard.h:28
isc
Defines the logger used by the top-level component of kea-lfc.
Definition
agent_parser.cc:148
src
lib
util
unlock_guard.h
Generated on Wed Nov 20 2024 11:53:25 for Kea by
1.10.0