More threads work.

Adds stubs (and sometimes implementations) for dalvik.system.VMStack and
java.lang.Thread native methods. There was a bug in the dalvik
thread priority setting code, where the current thread and the passed-in
thread were confused.

I've also pulled Mutex and ThreadList out into their own files, and
moved some functionality around (with the aim of having more stuff
private, especially locks).

Change-Id: Ieb0f22669cac3df44ca34f7868f8e7d4dfa09ab6
diff --git a/src/jni_internal.h b/src/jni_internal.h
index a0fe8fc..a723b32 100644
--- a/src/jni_internal.h
+++ b/src/jni_internal.h
@@ -8,6 +8,7 @@
 #include "heap.h"
 #include "indirect_reference_table.h"
 #include "macros.h"
+#include "mutex.h"
 #include "reference_table.h"
 #include "runtime.h"
 
@@ -18,7 +19,6 @@
 class ClassLoader;
 class Libraries;
 class Method;
-class Mutex;
 class Thread;
 
 void JniAbort(const char* jni_function_name);
@@ -64,18 +64,18 @@
   bool work_around_app_jni_bugs;
 
   // Used to hold references to pinned primitive arrays.
-  Mutex* pins_lock;
+  Mutex pins_lock;
   ReferenceTable pin_table;
 
   // JNI global references.
-  Mutex* globals_lock;
+  Mutex globals_lock;
   IndirectReferenceTable globals;
 
   // JNI weak global references.
-  Mutex* weak_globals_lock;
+  Mutex weak_globals_lock;
   IndirectReferenceTable weak_globals;
 
-  Mutex* libraries_lock;
+  Mutex libraries_lock;
   Libraries* libraries;
 
   // Used by -Xcheck:jni.