summaryrefslogtreecommitdiff
path: root/runtime/thread.cc
diff options
context:
space:
mode:
author Hiroshi Yamauchi <yamauchi@google.com> 2015-11-14 02:15:09 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-11-14 02:15:09 +0000
commitdd4cbcc924c8ba2a578914a4a366996693bdcd74 (patch)
tree2fe66e258de36bcebc913d48e04468b7c639578f /runtime/thread.cc
parent0e06a0989f4fc53e0d281a5a2cb5b5a17feaea0c (diff)
parent04302dbb106d590ff72c0dfecda23d85b6565059 (diff)
Merge "Fix class unloading with the CC collector."
Diffstat (limited to 'runtime/thread.cc')
-rw-r--r--runtime/thread.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc
index b0cf418507..30eb2545f7 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -1886,6 +1886,14 @@ mirror::Object* Thread::DecodeJObject(jobject obj) const {
return result;
}
+bool Thread::IsJWeakCleared(jweak obj) const {
+ CHECK(obj != nullptr);
+ IndirectRef ref = reinterpret_cast<IndirectRef>(obj);
+ IndirectRefKind kind = GetIndirectRefKind(ref);
+ CHECK_EQ(kind, kWeakGlobal);
+ return tlsPtr_.jni_env->vm->IsWeakGlobalCleared(const_cast<Thread*>(this), ref);
+}
+
// Implements java.lang.Thread.interrupted.
bool Thread::Interrupted() {
MutexLock mu(Thread::Current(), *wait_mutex_);