diff options
| author | 2015-07-26 15:56:45 +0200 | |
|---|---|---|
| committer | 2015-07-26 16:28:44 +0200 | |
| commit | facb2555a9dab30eb76281122f3917f21e58fe84 (patch) | |
| tree | 9bf2c5f62219e58de96890922025b95d7722272e /src/video_core/debug_utils | |
| parent | citra-qt/command list: Do not recreate a widget after each selection (diff) | |
| download | yuzu-facb2555a9dab30eb76281122f3917f21e58fe84.tar.gz yuzu-facb2555a9dab30eb76281122f3917f21e58fe84.tar.xz yuzu-facb2555a9dab30eb76281122f3917f21e58fe84.zip | |
citra-qt/debug_utils: Use lock_guard everywhere
unique_lock were being used as lock_guards.
Also replaced manual lock/unlock by lock_guard for harmonization.
Diffstat (limited to 'src/video_core/debug_utils')
| -rw-r--r-- | src/video_core/debug_utils/debug_utils.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index 827b09dff..27000283d 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp | |||
| @@ -62,7 +62,7 @@ void DebugContext::OnEvent(Event event, void* data) { | |||
| 62 | 62 | ||
| 63 | void DebugContext::Resume() { | 63 | void DebugContext::Resume() { |
| 64 | { | 64 | { |
| 65 | std::unique_lock<std::mutex> lock(breakpoint_mutex); | 65 | std::lock_guard<std::mutex> lock(breakpoint_mutex); |
| 66 | 66 | ||
| 67 | // Tell all observers that we are about to resume | 67 | // Tell all observers that we are about to resume |
| 68 | for (auto& breakpoint_observer : breakpoint_observers) { | 68 | for (auto& breakpoint_observer : breakpoint_observers) { |
| @@ -268,11 +268,10 @@ void StartPicaTracing() | |||
| 268 | return; | 268 | return; |
| 269 | } | 269 | } |
| 270 | 270 | ||
| 271 | pica_trace_mutex.lock(); | 271 | std::lock_guard<std::mutex> lock(pica_trace_mutex); |
| 272 | pica_trace = std::unique_ptr<PicaTrace>(new PicaTrace); | 272 | pica_trace = std::unique_ptr<PicaTrace>(new PicaTrace); |
| 273 | 273 | ||
| 274 | is_pica_tracing = true; | 274 | is_pica_tracing = true; |
| 275 | pica_trace_mutex.unlock(); | ||
| 276 | } | 275 | } |
| 277 | 276 | ||
| 278 | bool IsPicaTracing() | 277 | bool IsPicaTracing() |
| @@ -286,7 +285,7 @@ void OnPicaRegWrite(PicaTrace::Write write) | |||
| 286 | if (!is_pica_tracing) | 285 | if (!is_pica_tracing) |
| 287 | return; | 286 | return; |
| 288 | 287 | ||
| 289 | std::unique_lock<std::mutex> lock(pica_trace_mutex); | 288 | std::lock_guard<std::mutex> lock(pica_trace_mutex); |
| 290 | 289 | ||
| 291 | if (!is_pica_tracing) | 290 | if (!is_pica_tracing) |
| 292 | return; | 291 | return; |
| @@ -305,9 +304,9 @@ std::unique_ptr<PicaTrace> FinishPicaTracing() | |||
| 305 | is_pica_tracing = false; | 304 | is_pica_tracing = false; |
| 306 | 305 | ||
| 307 | // Wait until running tracing is finished | 306 | // Wait until running tracing is finished |
| 308 | pica_trace_mutex.lock(); | 307 | std::lock_guard<std::mutex> lock(pica_trace_mutex); |
| 309 | std::unique_ptr<PicaTrace> ret(std::move(pica_trace)); | 308 | std::unique_ptr<PicaTrace> ret(std::move(pica_trace)); |
| 310 | pica_trace_mutex.unlock(); | 309 | |
| 311 | return std::move(ret); | 310 | return std::move(ret); |
| 312 | } | 311 | } |
| 313 | 312 | ||