Move mutex.h into base/mutex.h.

We don't actually need any hackery to get the right mutex.h any
more, but since we planned on having the google3-like stuff
in google3-like locations, this is an easy one to fix.

Change-Id: Ie27464ebbc208a6f4e694a97cf26b1cee0737009
diff --git a/build/Android.common.mk b/build/Android.common.mk
index fcea916..e008779 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -130,6 +130,7 @@
 
 LIBART_COMMON_SRC_FILES := \
 	src/atomic.cc.arm \
+	src/base/mutex.cc \
 	src/base/unix_file/fd_file.cc \
 	src/base/unix_file/mapped_file.cc \
 	src/base/unix_file/null_file.cc \
@@ -181,7 +182,6 @@
 	src/mem_map.cc \
 	src/memory_region.cc \
 	src/monitor.cc \
-	src/mutex.cc \
 	src/native/dalvik_system_DexFile.cc \
 	src/native/dalvik_system_VMDebug.cc \
 	src/native/dalvik_system_VMRuntime.cc \
@@ -337,6 +337,7 @@
 
 
 LIBART_ENUM_OPERATOR_OUT_HEADER_FILES := \
+	src/base/mutex.h \
 	src/dex_file.h \
 	src/dex_instruction.h \
 	src/gc/space.h \
@@ -347,7 +348,6 @@
 	src/jdwp/jdwp.h \
 	src/jdwp/jdwp_constants.h \
 	src/locks.h \
-	src/mutex.h \
 	src/object.h \
 	src/thread.h \
 	src/verifier/method_verifier.h \
@@ -359,6 +359,7 @@
 
 TEST_COMMON_SRC_FILES := \
 	src/barrier_test.cc \
+	src/base/mutex_test.cc \
 	src/base/unix_file/fd_file_test.cc \
 	src/base/unix_file/mapped_file_test.cc \
 	src/base/unix_file/null_file_test.cc \
@@ -382,7 +383,6 @@
 	src/jni_compiler_test.cc \
 	src/oat/utils/arm/managed_register_arm_test.cc \
 	src/oat/utils/x86/managed_register_x86_test.cc \
-	src/mutex_test.cc \
 	src/oat_test.cc \
 	src/object_test.cc \
 	src/reference_table_test.cc \
diff --git a/src/atomic.cc b/src/atomic.cc
index 008aa87..5cc750d 100644
--- a/src/atomic.cc
+++ b/src/atomic.cc
@@ -19,7 +19,7 @@
 #include <pthread.h>
 #include <vector>
 
-#include "mutex.h"
+#include "base/mutex.h"
 #include "stl_util.h"
 #include "stringprintf.h"
 #include "thread.h"
diff --git a/src/barrier.cc b/src/barrier.cc
index 7dd2d9b..250d468 100644
--- a/src/barrier.cc
+++ b/src/barrier.cc
@@ -1,5 +1,22 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #include "barrier.h"
-#include "../src/mutex.h"
+
+#include "base/mutex.h"
 #include "thread.h"
 
 namespace art {
diff --git a/src/barrier.h b/src/barrier.h
index 86ce2fe..2b0429a 100644
--- a/src/barrier.h
+++ b/src/barrier.h
@@ -17,7 +17,7 @@
 #ifndef ART_SRC_BARRIER_H_
 #define ART_SRC_BARRIER_H_
 
-#include "../src/mutex.h"
+#include "base/mutex.h"
 #include "locks.h"
 #include "UniquePtr.h"
 
@@ -53,4 +53,3 @@
 
 }  // namespace art
 #endif  // ART_SRC_GC_BARRIER_H_
-
diff --git a/src/base/macros.h b/src/base/macros.h
index d63aed6..52013da 100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_SRC_MACROS_H_
-#define ART_SRC_MACROS_H_
+#ifndef ART_SRC_BASE_MACROS_H_
+#define ART_SRC_BASE_MACROS_H_
 
 #include <stddef.h>  // for size_t
 
@@ -186,4 +186,4 @@
 
 #endif // defined(__SUPPORT_TS_ANNOTATION__)
 
-#endif  // ART_SRC_MACROS_H_
+#endif  // ART_SRC_BASE_MACROS_H_
diff --git a/src/mutex.cc b/src/base/mutex.cc
similarity index 100%
rename from src/mutex.cc
rename to src/base/mutex.cc
diff --git a/src/mutex.h b/src/base/mutex.h
similarity index 98%
rename from src/mutex.h
rename to src/base/mutex.h
index 6cfd4b9..af7becf 100644
--- a/src/mutex.h
+++ b/src/base/mutex.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_SRC_MUTEX_H_
-#define ART_SRC_MUTEX_H_
+#ifndef ART_SRC_BASE_MUTEX_H_
+#define ART_SRC_BASE_MUTEX_H_
 
 #include <pthread.h>
 #include <stdint.h>
@@ -359,4 +359,4 @@
 
 }  // namespace art
 
-#endif  // ART_SRC_MUTEX_H_
+#endif  // ART_SRC_BASE_MUTEX_H_
diff --git a/src/mutex_test.cc b/src/base/mutex_test.cc
similarity index 100%
rename from src/mutex_test.cc
rename to src/base/mutex_test.cc
diff --git a/src/class_linker.h b/src/class_linker.h
index cf93b8b..09a43c5 100644
--- a/src/class_linker.h
+++ b/src/class_linker.h
@@ -22,11 +22,11 @@
 #include <vector>
 
 #include "base/macros.h"
+#include "base/mutex.h"
 #include "dex_cache.h"
 #include "dex_file.h"
 #include "gtest/gtest.h"
 #include "heap.h"
-#include "mutex.h"
 #include "oat_file.h"
 #include "object.h"
 #include "safe_map.h"
diff --git a/src/common_throws.h b/src/common_throws.h
index e0766b6..33769c4 100644
--- a/src/common_throws.h
+++ b/src/common_throws.h
@@ -17,7 +17,7 @@
 #ifndef ART_SRC_COMMON_THROWS__H_
 #define ART_SRC_COMMON_THROWS_H_
 
-#include "mutex.h"
+#include "base/mutex.h"
 #include "object.h"
 
 namespace art {
diff --git a/src/compiler.h b/src/compiler.h
index bafd9d2..8facc96 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -21,13 +21,13 @@
 #include <string>
 #include <vector>
 
+#include "base/mutex.h"
 #include "compiled_class.h"
 #include "compiled_method.h"
 #include "dex_cache.h"
 #include "dex_file.h"
 #include "instruction_set.h"
 #include "invoke_type.h"
-#include "mutex.h"
 #include "oat_file.h"
 #include "object.h"
 #include "runtime.h"
diff --git a/src/compiler_llvm/compilation_unit.h b/src/compiler_llvm/compilation_unit.h
index 0b40388..5fb0c0c 100644
--- a/src/compiler_llvm/compilation_unit.h
+++ b/src/compiler_llvm/compilation_unit.h
@@ -17,7 +17,7 @@
 #ifndef ART_SRC_COMPILER_LLVM_COMPILATION_UNIT_H_
 #define ART_SRC_COMPILER_LLVM_COMPILATION_UNIT_H_
 
-#include "../mutex.h"
+#include "base/mutex.h"
 #include "globals.h"
 #if defined(ART_USE_DEXLANG_FRONTEND)
 # include "greenland/dex_lang.h"
diff --git a/src/gc/space.h b/src/gc/space.h
index 24427f1..f51ae5d 100644
--- a/src/gc/space.h
+++ b/src/gc/space.h
@@ -19,9 +19,9 @@
 
 #include <string>
 
-#include "../mutex.h"
 #include "UniquePtr.h"
 #include "base/macros.h"
+#include "base/mutex.h"
 #include "globals.h"
 #include "image.h"
 #include "dlmalloc.h"
diff --git a/src/intern_table.h b/src/intern_table.h
index 93d20b2..06a2b89 100644
--- a/src/intern_table.h
+++ b/src/intern_table.h
@@ -19,8 +19,8 @@
 
 #include <iosfwd>
 
+#include "base/mutex.h"
 #include "heap.h"
-#include "mutex.h"
 #include "object.h"
 #include "safe_map.h"
 
diff --git a/src/jdwp/jdwp.h b/src/jdwp/jdwp.h
index fbca7d1..d8e5981 100644
--- a/src/jdwp/jdwp.h
+++ b/src/jdwp/jdwp.h
@@ -17,10 +17,10 @@
 #ifndef ART_JDWP_JDWP_H_
 #define ART_JDWP_JDWP_H_
 
+#include "base/mutex.h"
 #include "jdwp/jdwp_bits.h"
 #include "jdwp/jdwp_constants.h"
 #include "jdwp/jdwp_expand_buf.h"
-#include "../mutex.h" // TODO: fix our include path!
 
 #include <pthread.h>
 #include <stddef.h>
diff --git a/src/jni_internal.cc b/src/jni_internal.cc
index d2c8fc4..43532c2 100644
--- a/src/jni_internal.cc
+++ b/src/jni_internal.cc
@@ -22,12 +22,12 @@
 #include <utility>
 #include <vector>
 
+#include "base/mutex.h"
 #include "class_linker.h"
 #include "class_loader.h"
 #include "invoke_arg_array_builder.h"
 #include "jni.h"
 #include "logging.h"
-#include "mutex.h"
 #include "object.h"
 #include "object_utils.h"
 #include "runtime.h"
diff --git a/src/jni_internal.h b/src/jni_internal.h
index 606887c..6b597ec 100644
--- a/src/jni_internal.h
+++ b/src/jni_internal.h
@@ -20,9 +20,9 @@
 #include "jni.h"
 
 #include "base/macros.h"
+#include "base/mutex.h"
 #include "heap.h"
 #include "indirect_reference_table.h"
-#include "mutex.h"
 #include "reference_table.h"
 #include "runtime.h"
 
diff --git a/src/locks.cc b/src/locks.cc
index 0422aff..27b9d4b 100644
--- a/src/locks.cc
+++ b/src/locks.cc
@@ -16,7 +16,7 @@
 
 #include "locks.h"
 
-#include "mutex.h"
+#include "base/mutex.h"
 
 namespace art {
 
diff --git a/src/logging.cc b/src/logging.cc
index 12d1fa4..6d0452b 100644
--- a/src/logging.cc
+++ b/src/logging.cc
@@ -16,7 +16,7 @@
 
 #include "logging.h"
 
-#include "mutex.h"
+#include "base/mutex.h"
 #include "runtime.h"
 #include "thread.h"
 #include "utils.h"
diff --git a/src/monitor.cc b/src/monitor.cc
index 1fbda87..d58f462 100644
--- a/src/monitor.cc
+++ b/src/monitor.cc
@@ -18,9 +18,9 @@
 
 #include <vector>
 
+#include "base/mutex.h"
 #include "class_linker.h"
 #include "dex_instruction.h"
-#include "mutex.h"
 #include "object.h"
 #include "object_utils.h"
 #include "scoped_thread_state_change.h"
diff --git a/src/monitor.h b/src/monitor.h
index 4277d2c..c3b4b21 100644
--- a/src/monitor.h
+++ b/src/monitor.h
@@ -23,8 +23,8 @@
 #include <iosfwd>
 #include <list>
 
+#include "base/mutex.h"
 #include "heap.h"
-#include "mutex.h"
 #include "thread.h"
 
 namespace art {
diff --git a/src/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc b/src/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
index 9423795..cbf6400 100644
--- a/src/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
+++ b/src/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc
@@ -14,10 +14,10 @@
  * limitations under the License.
  */
 
+#include "base/mutex.h"
 #include "debugger.h"
 #include "jni_internal.h"
 #include "logging.h"
-#include "../mutex.h"  // Avoid pulling in icu4c's mutex.h
 #include "scoped_thread_state_change.h"
 #include "ScopedLocalRef.h"
 #include "ScopedPrimitiveArray.h"
diff --git a/src/oat/runtime/callee_save_frame.h b/src/oat/runtime/callee_save_frame.h
index a8ebce8..fe66b91 100644
--- a/src/oat/runtime/callee_save_frame.h
+++ b/src/oat/runtime/callee_save_frame.h
@@ -17,7 +17,7 @@
 #ifndef ART_SRC_OAT_RUNTIME_CALLEE_SAVE_FRAME_H_
 #define ART_SRC_OAT_RUNTIME_CALLEE_SAVE_FRAME_H_
 
-#include "../src/mutex.h"
+#include "base/mutex.h"
 #include "thread.h"
 
 namespace art {
diff --git a/src/reference_table.cc b/src/reference_table.cc
index 19b6d42..cdb3004 100644
--- a/src/reference_table.cc
+++ b/src/reference_table.cc
@@ -16,8 +16,8 @@
 
 #include "reference_table.h"
 
+#include "base/mutex.h"
 #include "indirect_reference_table.h"
-#include "mutex.h"
 
 #include "object.h"
 
diff --git a/src/runtime_linux.cc b/src/runtime_linux.cc
index e2050d1..ee1e7c5 100644
--- a/src/runtime_linux.cc
+++ b/src/runtime_linux.cc
@@ -20,8 +20,8 @@
 #include <string.h>
 #include <sys/utsname.h>
 
+#include "base/mutex.h"
 #include "logging.h"
-#include "mutex.h"
 #include "stringprintf.h"
 #include "thread.h"
 #include "utils.h"
diff --git a/src/signal_catcher.h b/src/signal_catcher.h
index 074267e..de0220b 100644
--- a/src/signal_catcher.h
+++ b/src/signal_catcher.h
@@ -17,7 +17,7 @@
 #ifndef ART_SRC_SIGNAL_CATCHER_H_
 #define ART_SRC_SIGNAL_CATCHER_H_
 
-#include "mutex.h"
+#include "base/mutex.h"
 
 namespace art {
 
diff --git a/src/thread.cc b/src/thread.cc
index fb7aa5a..aa13ad2 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -28,6 +28,7 @@
 #include <iostream>
 #include <list>
 
+#include "base/mutex.h"
 #include "class_linker.h"
 #include "class_loader.h"
 #include "cutils/atomic.h"
@@ -37,7 +38,6 @@
 #include "heap.h"
 #include "jni_internal.h"
 #include "monitor.h"
-#include "mutex.h"
 #include "oat/runtime/context.h"
 #include "object.h"
 #include "object_utils.h"
diff --git a/src/thread_list.cc b/src/thread_list.cc
index 3834725..3ca4cd4 100644
--- a/src/thread_list.cc
+++ b/src/thread_list.cc
@@ -20,8 +20,8 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#include "base/mutex.h"
 #include "debugger.h"
-#include "mutex.h"
 #include "timing_logger.h"
 #include "utils.h"
 
diff --git a/src/thread_list.h b/src/thread_list.h
index fb989ab..2335fa8 100644
--- a/src/thread_list.h
+++ b/src/thread_list.h
@@ -17,7 +17,7 @@
 #ifndef ART_SRC_THREAD_LIST_H_
 #define ART_SRC_THREAD_LIST_H_
 
-#include "mutex.h"
+#include "base/mutex.h"
 #include "thread.h"
 
 namespace art {
diff --git a/src/thread_pool.h b/src/thread_pool.h
index 668dfe0..e97d7d6 100644
--- a/src/thread_pool.h
+++ b/src/thread_pool.h
@@ -21,9 +21,9 @@
 #include <vector>
 
 #include "barrier.h"
+#include "base/mutex.h"
 #include "closure.h"
 #include "locks.h"
-#include "../src/mutex.h"
 
 namespace art {
 
diff --git a/src/well_known_classes.h b/src/well_known_classes.h
index fd8f19b..f2c479c 100644
--- a/src/well_known_classes.h
+++ b/src/well_known_classes.h
@@ -17,8 +17,8 @@
 #ifndef ART_SRC_WELL_KNOWN_CLASSES_H_
 #define ART_SRC_WELL_KNOWN_CLASSES_H_
 
+#include "base/mutex.h"
 #include "jni.h"
-#include "mutex.h"
 
 namespace art {