summaryrefslogtreecommitdiffstats
path: root/runtime/gc/reference_processor.cc
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-05-08 15:27:31 -0700
committerMathieu Chartier <mathieuc@google.com>2014-05-08 16:59:29 -0700
commit2d1ab0a7bf7639d1af0c453415f9625110c34f6d (patch)
tree765ff7d49c4a9016bfbdf92a43f2aed2c0d0f4d3 /runtime/gc/reference_processor.cc
parent4884ba0c06fbd167a29a057787f4f35160d2ebd1 (diff)
downloadandroid_art-2d1ab0a7bf7639d1af0c453415f9625110c34f6d.tar.gz
android_art-2d1ab0a7bf7639d1af0c453415f9625110c34f6d.tar.bz2
android_art-2d1ab0a7bf7639d1af0c453415f9625110c34f6d.zip
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
Diffstat (limited to 'runtime/gc/reference_processor.cc')
-rw-r--r--runtime/gc/reference_processor.cc4
1 files changed, 2 insertions, 2 deletions
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();
}