ad_rss
include
ad
rss
core
shared_lock_guard.hpp
Go to the documentation of this file.
1
// ----------------- BEGIN LICENSE BLOCK ---------------------------------
2
//
3
// Copyright (C) 2022 Intel Corporation
4
//
5
// SPDX-License-Identifier: LGPL-2.1-only
6
//
7
// ----------------- END LICENSE BLOCK -----------------------------------
12
#pragma once
13
14
#include <mutex>
15
#include <shared_mutex>
16
20
namespace
ad
{
24
namespace
rss {
28
namespace
core {
29
30
class
shared_lock_guard
31
{
32
public
:
33
shared_lock_guard
(std::shared_timed_mutex &lock)
34
: mLock(lock)
35
{
36
mLock.lock_shared();
37
}
38
~
shared_lock_guard
()
39
{
40
mLock.unlock_shared();
41
}
42
43
private
:
44
std::shared_timed_mutex &mLock;
45
};
46
47
}
// namespace core
48
}
// namespace rss
49
}
// namespace ad
ad::rss::core::shared_lock_guard
Definition:
shared_lock_guard.hpp:31
ad
namespace ad
Definition:
LateralRelativePosition.hpp:28
Generated by
1.9.1