summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Vyssotski <pavel.n.vyssotski@intel.com>2014-12-15 18:00:17 +0600
committerPavel Vyssotski <pavel.n.vyssotski@intel.com>2014-12-15 18:00:17 +0600
commitd64ba3813069b9d178eb2b8655c9675a20160364 (patch)
tree4e7c72e8dfa02c38435842c9a709933974e23950
parent152f391b17080e2dcc2294425c7fa2afe73a4f44 (diff)
downloadart-d64ba3813069b9d178eb2b8655c9675a20160364.tar.gz
art-d64ba3813069b9d178eb2b8655c9675a20160364.tar.bz2
art-d64ba3813069b9d178eb2b8655c9675a20160364.zip
Use WaitHoldingLocks in ReferenceProcessor::MakeCircularListIfUnenqueued.
The caller may be holding mutator_lock_, so we must use WaitHoldingLocks. Otherwise we get 'bad_mutexes_held' error with debug build. See also https://android-review.googlesource.com/#/c/93892. Change-Id: I87b1119e22a9934fdc622c4c4e2690b8b552b539 Signed-off-by: Pavel Vyssotski <pavel.n.vyssotski@intel.com>
-rw-r--r--runtime/gc/reference_processor.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/gc/reference_processor.cc b/runtime/gc/reference_processor.cc
index 012f9f91f5..99bd63fa8a 100644
--- a/runtime/gc/reference_processor.cc
+++ b/runtime/gc/reference_processor.cc
@@ -234,7 +234,7 @@ bool ReferenceProcessor::MakeCircularListIfUnenqueued(mirror::FinalizerReference
MutexLock mu(self, *Locks::reference_processor_lock_);
// Wait untul we are done processing reference.
while (SlowPathEnabled()) {
- condition_.Wait(self);
+ condition_.WaitHoldingLocks(self);
}
// At this point, since the sentinel of the reference is live, it is guaranteed to not be
// enqueued if we just finished processing references. Otherwise, we may be doing the main GC