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/build/Android.common.mk b/build/Android.common.mk
index 3c203d4..f248029 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -64,6 +64,7 @@
 	src/compiler/codegen/arm/Assemble.cc \
 	src/compiler/codegen/arm/LocalOptimizations.cc \
 	src/compiler/codegen/arm/armv7-a/Codegen.cc \
+	src/dalvik_system_VMStack.cc \
 	src/dex_cache.cc \
 	src/dex_file.cc \
 	src/dex_instruction.cc \
@@ -79,6 +80,7 @@
 	src/java_lang_Runtime.cc \
 	src/java_lang_String.cc \
 	src/java_lang_System.cc \
+	src/java_lang_Thread.cc \
 	src/java_lang_Throwable.cc \
 	src/java_util_concurrent_atomic_AtomicLong.cc \
 	src/jni_compiler.cc \
@@ -92,6 +94,7 @@
 	src/managed_register_x86.cc \
 	src/memory_region.cc \
 	src/mspace.c \
+	src/mutex.cc \
 	src/object.cc \
 	src/object_bitmap.cc \
 	src/offsets.cc \
@@ -103,6 +106,7 @@
 	src/stringpiece.cc \
 	src/stringprintf.cc \
 	src/thread.cc \
+	src/thread_list.cc \
 	src/utf.cc \
 	src/utils.cc \
 	src/zip_archive.cc \
@@ -112,12 +116,14 @@
 	$(LIBART_COMMON_SRC_FILES) \
 	src/logging_android.cc \
 	src/runtime_android.cc \
+	src/thread_android.cc \
 	src/thread_arm.cc
 
 LIBART_HOST_SRC_FILES := \
 	$(LIBART_COMMON_SRC_FILES) \
 	src/logging_linux.cc \
 	src/runtime_linux.cc \
+	src/thread_linux.cc \
 	src/thread_x86.cc
 
 LIBARTTEST_COMMON_SRC_FILES := \