Change intern table to not use WaitHoldingLocks

Bug: 22423014
Change-Id: I9e16b8cb4def72fff73f1783a182877105feb7aa
diff --git a/runtime/thread.cc b/runtime/thread.cc
index cede998..b9753e1 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -2734,4 +2734,12 @@
   tlsPtr_.method_verifier = verifier->link_;
 }
 
+size_t Thread::NumberOfHeldMutexes() const {
+  size_t count = 0;
+  for (BaseMutex* mu : tlsPtr_.held_mutexes) {
+    count += static_cast<size_t>(mu != nullptr);
+  }
+  return count;
+}
+
 }  // namespace art