Wayverb
threading_policies.h
1 #pragma once
2 
3 #include <mutex>
4 
5 namespace util {
6 namespace threading_policy {
7 
8 class no_lock final {
9 public:
10  auto get_lock() const {
11  struct ret {};
12  return ret{};
13  }
14 };
15 
16 class scoped_lock final {
17 public:
18  auto get_lock() const { return std::unique_lock<std::mutex>{mutex_}; }
19 
20 private:
21  mutable std::mutex mutex_;
22 };
23 
24 } // namespace threading_policy
25 } // namespace util
Definition: allocator.h:6
Definition: threading_policies.h:16
Definition: threading_policies.h:8