commit | ffc8cad04135192a8d10e7f38bd97c48101294a8 | [log] [tgz] |
---|---|---|
author | Nicolas Geoffray <ngeoffray@google.com> | Fri Feb 10 10:59:22 2017 +0000 |
committer | Nicolas Geoffray <ngeoffray@google.com> | Tue Feb 14 15:42:29 2017 +0000 |
tree | fb90432ea5e6d218891c0b3fcccc0fa77d202f7d | |
parent | 4e4b62e21672dbacf5d5abb688a126aabad29269 [diff] [blame] |
Add a DCHECK in thread::GetPeer. Motivated by https://android-review.googlesource.com/#/c/333205/. Test: test-art-host run-jdwp-test.sh Change-Id: I173c060324aa0dc39144db55e3a97e672c012ba8
diff --git a/runtime/thread.h b/runtime/thread.h index 3a1b7da..5dd6ae1 100644 --- a/runtime/thread.h +++ b/runtime/thread.h
@@ -358,6 +358,7 @@ uint64_t GetCpuMicroTime() const; mirror::Object* GetPeer() const REQUIRES_SHARED(Locks::mutator_lock_) { + DCHECK(Thread::Current() == this) << "Use GetPeerFromOtherThread instead"; CHECK(tlsPtr_.jpeer == nullptr); return tlsPtr_.opeer; }