From 2d1ab0a7bf7639d1af0c453415f9625110c34f6d Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 8 May 2014 15:27:31 -0700 Subject: Use WaitHoldingLocks in ReferenceProcessor::GetReferent. The caller may be holding other locks, so we must use this or else we get bad mutexes held errors. Also added a lock level for the reference processor. Change-Id: I364a303a4106982bd9bfaac5b116cea1638ea6d3 --- runtime/gc/reference_processor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/gc/reference_processor.cc') diff --git a/runtime/gc/reference_processor.cc b/runtime/gc/reference_processor.cc index ef9e1d4ee9..188b6b3f1a 100644 --- a/runtime/gc/reference_processor.cc +++ b/runtime/gc/reference_processor.cc @@ -28,7 +28,7 @@ namespace gc { ReferenceProcessor::ReferenceProcessor() : process_references_args_(nullptr, nullptr, nullptr), slow_path_enabled_(false), - preserving_references_(false), lock_("reference processor lock"), + preserving_references_(false), lock_("reference processor lock", kReferenceProcessorLock), condition_("reference processor condition", lock_) { } @@ -71,7 +71,7 @@ mirror::Object* ReferenceProcessor::GetReferent(Thread* self, mirror::Reference* return obj; } } - condition_.Wait(self); + condition_.WaitHoldingLocks(self); } return reference->GetReferent(); } -- cgit v1.2.3-59-g8ed1b