Show current values of mutexes in thread dump.

Experimental feature; may or may not be useful.  Dump the current value
of half a dozen VM mutexes.  This will tell us if they're unlocked,
locked, or contended-for at the point somebody does a thread dump.  For
example, when the GC notices the HeapWorker watchdog has expired:

  I/dalvikvm( 2828): DALVIK THREADS:
  I/dalvikvm( 2828): (mutexes: tll=0 tsl=0 tscl=0 ghl=1 hwl=1 hwll=0)

In this case, gcHeapLock and heapWorkerLock are held, the rest are not.

If this turns out to be useful we can put more effort into the output
format.  The pthread lib doesn't insert the thread ID unless you're
using recursive or errorcheck mutexes, which (for performance reasons)
we try not to use.

Change-Id: I272534d8c9db6340cfc23bfdddb47beefc2efbfb
diff --git a/vm/Thread.c b/vm/Thread.c
index 0e8e631..63b07cb 100644
--- a/vm/Thread.c
+++ b/vm/Thread.c
@@ -3560,6 +3560,17 @@
 
     dvmPrintDebugMessage(target, "DALVIK THREADS:\n");
 
+#ifdef HAVE_ANDROID_OS
+    dvmPrintDebugMessage(target,
+        "(mutexes: tll=%x tsl=%x tscl=%x ghl=%x hwl=%x hwll=%x)\n",
+        gDvm.threadListLock.value,
+        gDvm._threadSuspendLock.value,
+        gDvm.threadSuspendCountLock.value,
+        gDvm.gcHeapLock.value,
+        gDvm.heapWorkerLock.value,
+        gDvm.heapWorkerListLock.value);
+#endif
+
     if (grabLock)
         dvmLockThreadList(dvmThreadSelf());