From a1785c5cd88f6256a838a95c93ac0a1bee6c5145 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Tue, 25 Nov 2014 20:40:08 -0800 Subject: [PATCH] ART: Use Overwrite instead of Put Allow threads exiting twice when tracing. Bug: 18469797 Change-Id: I88ce5ea8237e53a76ad68fd4b28a367f58e6d635 --- runtime/trace.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/trace.cc b/runtime/trace.cc index 2cc50b373..b5108443b 100644 --- a/runtime/trace.cc +++ b/runtime/trace.cc @@ -735,7 +735,9 @@ void Trace::StoreExitingThreadInfo(Thread* thread) { if (the_trace_ != nullptr) { std::string name; thread->GetThreadName(name); - the_trace_->exited_threads_.Put(thread->GetTid(), name); + // The same thread/tid may be used multiple times. As SafeMap::Put does not allow to override + // a previous mapping, use SafeMap::Overwrite. + the_trace_->exited_threads_.Overwrite(thread->GetTid(), name); } } -- 2.11.0