Kea 2.7.6
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
12namespace isc {
13namespace util {
14
20template<typename Mutex>
21class UnlockGuard : public boost::noncopyable {
22public:
28 explicit UnlockGuard(Mutex& lock) : lock_(lock) {
29 lock_.unlock();
30 }
31
36 lock_.lock();
37 }
38
39private:
41 Mutex& lock_;
42};
43
44} // namespace util
45} // namespace isc
46
47#endif // UNLOCK_GUARD_H
~UnlockGuard()
Destructor.
UnlockGuard(Mutex &lock)
Constructor.
Defines the logger used by the top-level component of kea-lfc.