Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3135)

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 2881563002: memory-infra: Fix deadlock in MemoryDumpManager (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_dump_manager.cc
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc
index 8d307cef5cbe7c0dc5eafad2bddf6f9ea08e0687..5d15caef19f15090086e511a39734438b24b09cc 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -173,9 +173,18 @@ MemoryDumpManager::MemoryDumpManager()
}
MemoryDumpManager::~MemoryDumpManager() {
- AutoLock lock(lock_);
- if (dump_thread_) {
- dump_thread_->Stop();
+ Thread* dump_thread = nullptr;
+ {
+ AutoLock lock(lock_);
+ if (dump_thread_) {
+ dump_thread = dump_thread_.get();
+ }
+ }
+ if (dump_thread) {
+ dump_thread->Stop();
+ }
+ {
Primiano Tucci (use gerrit) 2017/05/11 13:53:27 no need for these extra set of braces here
hjd 2017/05/11 14:18:41 Done.
+ AutoLock lock(lock_);
dump_thread_.reset();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698