diff options
| author | Lioncash <mathew1800@gmail.com> | 2019-04-01 12:29:59 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2019-04-01 12:53:47 -0400 |
| commit | 781ab8407b50d303197ab6fb888ed35ecbcce23a (patch) | |
| tree | eaf2aabd5471c13fe89ac5f7da247b3bf1248e83 /src/video_core/debug_utils/debug_utils.h | |
| parent | d9b7bc44748908d49d59433870211df8e1c32581 (diff) | |
general: Use deducation guides for std::lock_guard and std::unique_lock
Since C++17, the introduction of deduction guides for locking facilities
means that we no longer need to hardcode the mutex type into the locks
themselves, making it easier to switch mutex types, should it ever be
necessary in the future.
Diffstat (limited to 'src/video_core/debug_utils/debug_utils.h')
| -rw-r--r-- | src/video_core/debug_utils/debug_utils.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h index c235faf46..ac3a2eb01 100644 --- a/src/video_core/debug_utils/debug_utils.h +++ b/src/video_core/debug_utils/debug_utils.h @@ -40,7 +40,7 @@ public: /// Constructs the object such that it observes events of the given DebugContext. explicit BreakPointObserver(std::shared_ptr<DebugContext> debug_context) : context_weak(debug_context) { - std::unique_lock<std::mutex> lock(debug_context->breakpoint_mutex); + std::unique_lock lock{debug_context->breakpoint_mutex}; debug_context->breakpoint_observers.push_back(this); } @@ -48,7 +48,7 @@ public: auto context = context_weak.lock(); if (context) { { - std::unique_lock<std::mutex> lock(context->breakpoint_mutex); + std::unique_lock lock{context->breakpoint_mutex}; context->breakpoint_observers.remove(this); } |
