tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
tags.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2020 Tobias Hienzsch
3
4#ifndef TETL_MUTEX_TAGS_HPP
5#define TETL_MUTEX_TAGS_HPP
6
7namespace etl {
8
9/// \brief Empty struct tag types used to specify locking strategy for
10/// etl::lock_guard, etl::scoped_lock, etl::unique_lock, and etl::shared_lock.
11///
12/// \details Do not acquire ownership of the mutex.
13/// \ingroup mutex
15 explicit defer_lock_t() = default;
16};
17
18/// \brief Instances of empty struct tag types. See defer_lock_t.
19/// \relates defer_lock_t
20/// \ingroup mutex
21inline constexpr auto defer_lock = defer_lock_t{};
22
23/// \brief Empty struct tag types used to specify locking strategy for
24/// etl::lock_guard, etl::scoped_lock, etl::unique_lock, and etl::shared_lock.
25///
26/// \details Try to acquire ownership of the mutex without blocking.
27/// \ingroup mutex
29 explicit try_to_lock_t() = default;
30};
31
32/// \brief Instances of empty struct tag types. See try_to_lock_t.
33/// \relates try_to_lock_t
34/// \ingroup mutex
35inline constexpr auto try_to_lock = try_to_lock_t{};
36
37/// \brief Empty struct tag types used to specify locking strategy for
38/// etl::lock_guard, etl::scoped_lock, etl::unique_lock, and etl::shared_lock.
39///
40/// \details Assume the calling thread already has ownership of the mutex.
41/// \ingroup mutex
43 explicit adopt_lock_t() = default;
44};
45
46/// \brief Instances of empty struct tag types. See adopt_lock_t.
47/// \relates adopt_lock_t
48/// \ingroup mutex
49inline constexpr auto adopt_lock = adopt_lock_t{};
50
51} // namespace etl
52
53#endif // TETL_MUTEX_TAGS_HPP
constexpr auto try_to_lock
Instances of empty struct tag types. See try_to_lock_t.
Definition tags.hpp:35
constexpr auto defer_lock
Instances of empty struct tag types. See defer_lock_t.
Definition tags.hpp:21
constexpr auto adopt_lock
Instances of empty struct tag types. See adopt_lock_t.
Definition tags.hpp:49
Definition adjacent_find.hpp:9
Empty struct tag types used to specify locking strategy for etl::lock_guard, etl::scoped_lock,...
Definition tags.hpp:42
adopt_lock_t()=default
Empty struct tag types used to specify locking strategy for etl::lock_guard, etl::scoped_lock,...
Definition tags.hpp:14
defer_lock_t()=default
Empty struct tag types used to specify locking strategy for etl::lock_guard, etl::scoped_lock,...
Definition tags.hpp:28
try_to_lock_t()=default