diff options
author | 2012-12-12 17:47:30 -0800 | |
---|---|---|
committer | 2012-12-12 18:11:44 -0800 | |
commit | 76b6167407c2b6f5d40ad895b2793a6b037f54b2 (patch) | |
tree | 5c433a0907ddf401f4078b6703253b1ae75e723e | |
parent | f66330a747eff155eb571b634fc9d901c55a78a7 (diff) |
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
31 files changed, 52 insertions, 36 deletions
diff --git a/build/Android.common.mk b/build/Android.common.mk index fcea9168d0..e0087799d1 100644 --- a/build/Android.common.mk +++ b/build/Android.common.mk @@ -130,6 +130,7 @@ OATEXEC_SRC_FILES := \ 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 @@ LIBART_COMMON_SRC_FILES := \ 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 @@ endif # HOST_ARCH != x86 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 @@ LIBART_ENUM_OPERATOR_OUT_HEADER_FILES := \ 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 @@ LIBARTTEST_COMMON_SRC_FILES := \ 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 @@ TEST_COMMON_SRC_FILES := \ 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 008aa87151..5cc750d701 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 7dd2d9bea7..250d468adb 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 86ce2fe7da..2b0429a7c2 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 @@ class Barrier { } // namespace art #endif // ART_SRC_GC_BARRIER_H_ - diff --git a/src/base/macros.h b/src/base/macros.h index d63aed6dd2..52013dacc2 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 @@ template<typename T> void UNUSED(const T&) {} #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 index 16811d3e5b..16811d3e5b 100644 --- a/src/mutex.cc +++ b/src/base/mutex.cc diff --git a/src/mutex.h b/src/base/mutex.h index 6cfd4b938d..af7becfa48 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 @@ class SCOPED_LOCKABLE WriterMutexLock { } // 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 index 0b0f2c9003..0b0f2c9003 100644 --- a/src/mutex_test.cc +++ b/src/base/mutex_test.cc diff --git a/src/class_linker.h b/src/class_linker.h index cf93b8bb72..09a43c533c 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 e0766b6b9c..33769c49b8 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 bafd9d26eb..8facc9623c 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 0b40388cee..5fb0c0ccbc 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 24427f148e..f51ae5d785 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 93d20b2e2b..06a2b89e19 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 fbca7d1827..d8e598159c 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 d2c8fc4576..43532c23ba 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 606887c90b..6b597ec09e 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 0422affddc..27b9d4bf96 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 12d1fa46df..6d0452bcb3 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 1fbda876ba..d58f462c9e 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 4277d2c22a..c3b4b21da1 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 9423795d95..cbf6400003 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 a8ebce8fa1..fe66b91f64 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 19b6d428fb..cdb3004440 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 e2050d1205..ee1e7c5b8c 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 074267e3b4..de0220b11c 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 fb7aa5ab19..aa13ad23b3 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 383472580d..3ca4cd454f 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 fb989ab2bb..2335fa838d 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 668dfe0fd9..e97d7d6ebd 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 fd8f19bd69..f2c479c6c3 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 { |