diff options
-rw-r--r-- | runtime/thread-current-inl.h | 2 | ||||
-rw-r--r-- | runtime/thread_list.cc | 2 | ||||
-rw-r--r-- | runtime/thread_list.h | 25 | ||||
-rw-r--r-- | runtime/thread_pool.cc | 2 | ||||
-rw-r--r-- | runtime/thread_pool.h | 23 | ||||
-rw-r--r-- | runtime/thread_pool_test.cc | 2 | ||||
-rw-r--r-- | runtime/thread_state.h | 6 | ||||
-rw-r--r-- | runtime/ti/agent.cc | 2 | ||||
-rw-r--r-- | runtime/ti/agent.h | 4 | ||||
-rw-r--r-- | runtime/trace.cc | 2 | ||||
-rw-r--r-- | runtime/trace.h | 2 | ||||
-rw-r--r-- | runtime/transaction.cc | 2 | ||||
-rw-r--r-- | runtime/transaction.h | 2 | ||||
-rw-r--r-- | runtime/transaction_test.cc | 2 | ||||
-rw-r--r-- | runtime/two_runtimes_test.cc | 2 |
15 files changed, 43 insertions, 37 deletions
diff --git a/runtime/thread-current-inl.h b/runtime/thread-current-inl.h index d12a45c556..ecc7067dac 100644 --- a/runtime/thread-current-inl.h +++ b/runtime/thread-current-inl.h @@ -25,7 +25,7 @@ #include <pthread.h> -namespace art { +namespace art HIDDEN { inline Thread* Thread::Current() { // We rely on Thread::Current returning null for a detached thread, so it's not obvious diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc index 561c551b70..d5face195d 100644 --- a/runtime/thread_list.cc +++ b/runtime/thread_list.cc @@ -62,7 +62,7 @@ #endif #endif // ART_USE_FUTEXES -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/thread_list.h b/runtime/thread_list.h index 7a986f6471..cb7744056f 100644 --- a/runtime/thread_list.h +++ b/runtime/thread_list.h @@ -20,6 +20,7 @@ #include "barrier.h" #include "base/histogram.h" #include "base/mutex.h" +#include "base/macros.h" #include "base/value_object.h" #include "jni.h" #include "reflective_handle_scope.h" @@ -29,7 +30,7 @@ #include <list> #include <vector> -namespace art { +namespace art HIDDEN { namespace gc { namespace collector { class GarbageCollector; @@ -63,21 +64,21 @@ class ThreadList { void DumpForSigQuit(std::ostream& os) REQUIRES(!Locks::thread_list_lock_, !Locks::mutator_lock_); // For thread suspend timeout dumps. - void Dump(std::ostream& os, bool dump_native_stack = true) + EXPORT void Dump(std::ostream& os, bool dump_native_stack = true) REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_); pid_t GetLockOwner(); // For SignalCatcher. // Thread suspension support. - void ResumeAll() + EXPORT void ResumeAll() REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_) UNLOCK_FUNCTION(Locks::mutator_lock_); - bool Resume(Thread* thread, SuspendReason reason = SuspendReason::kInternal) + EXPORT bool Resume(Thread* thread, SuspendReason reason = SuspendReason::kInternal) REQUIRES(!Locks::thread_suspend_count_lock_) WARN_UNUSED; // Suspends all other threads and gets exclusive access to the mutator lock. // If long_suspend is true, then other threads who try to suspend will never timeout. // long_suspend is currenly used for hprof since large heaps take a long time. - void SuspendAll(const char* cause, bool long_suspend = false) + EXPORT void SuspendAll(const char* cause, bool long_suspend = false) EXCLUSIVE_LOCK_FUNCTION(Locks::mutator_lock_) REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_, @@ -85,7 +86,7 @@ class ThreadList { // Suspend a thread using a peer, typically used by the debugger. Returns the thread on success, // else null. The peer is used to identify the thread to avoid races with the thread terminating. - Thread* SuspendThreadByPeer(jobject peer, SuspendReason reason) + EXPORT Thread* SuspendThreadByPeer(jobject peer, SuspendReason reason) REQUIRES(!Locks::mutator_lock_, !Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_); @@ -100,7 +101,7 @@ class ThreadList { !Locks::thread_suspend_count_lock_); // Find an existing thread (or self) by its thread id (not tid). - Thread* FindThreadByThreadId(uint32_t thread_id) REQUIRES(Locks::thread_list_lock_); + EXPORT Thread* FindThreadByThreadId(uint32_t thread_id) REQUIRES(Locks::thread_list_lock_); // Find an existing thread (or self) by its tid (not thread id). Thread* FindThreadByTid(int tid) REQUIRES(Locks::thread_list_lock_); @@ -120,7 +121,7 @@ class ThreadList { // lock (see mutator_gc_coord.md) then, since the checkpoint code may not acquire or release the // mutator lock, the checkpoint will have no way to access Java data. // TODO: Is it possible to just require the mutator lock here? - size_t RunCheckpoint(Closure* checkpoint_function, + EXPORT size_t RunCheckpoint(Closure* checkpoint_function, Closure* callback = nullptr, bool allow_lock_checking = true) REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_); @@ -156,7 +157,7 @@ class ThreadList { !Locks::thread_suspend_count_lock_); // Iterates over all the threads. - void ForEach(void (*callback)(Thread*, void*), void* context) + EXPORT void ForEach(void (*callback)(Thread*, void*), void* context) REQUIRES(Locks::thread_list_lock_); template<typename CallBack> @@ -190,7 +191,7 @@ class ThreadList { void VisitReflectiveTargets(ReflectiveValueVisitor* visitor) const REQUIRES(Locks::mutator_lock_); - void SweepInterpreterCaches(IsMarkedVisitor* visitor) const + EXPORT void SweepInterpreterCaches(IsMarkedVisitor* visitor) const REQUIRES(Locks::mutator_lock_, !Locks::thread_list_lock_); // Return a copy of the thread list. @@ -282,13 +283,13 @@ class ThreadList { // Helper for suspending all threads and getting exclusive access to the mutator lock. class ScopedSuspendAll : public ValueObject { public: - explicit ScopedSuspendAll(const char* cause, bool long_suspend = false) + EXPORT explicit ScopedSuspendAll(const char* cause, bool long_suspend = false) EXCLUSIVE_LOCK_FUNCTION(Locks::mutator_lock_) REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_, !Locks::mutator_lock_); // No REQUIRES(mutator_lock_) since the unlock function already asserts this. - ~ScopedSuspendAll() + EXPORT ~ScopedSuspendAll() REQUIRES(!Locks::thread_list_lock_, !Locks::thread_suspend_count_lock_) UNLOCK_FUNCTION(Locks::mutator_lock_); }; diff --git a/runtime/thread_pool.cc b/runtime/thread_pool.cc index 94be45794f..f0ea078cdc 100644 --- a/runtime/thread_pool.cc +++ b/runtime/thread_pool.cc @@ -34,7 +34,7 @@ #include "runtime.h" #include "thread-current-inl.h" -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/thread_pool.h b/runtime/thread_pool.h index 9c0cbb03f1..6d176546c3 100644 --- a/runtime/thread_pool.h +++ b/runtime/thread_pool.h @@ -22,10 +22,11 @@ #include <vector> #include "barrier.h" +#include "base/macros.h" #include "base/mem_map.h" #include "base/mutex.h" -namespace art { +namespace art HIDDEN { class AbstractThreadPool; @@ -115,13 +116,13 @@ class AbstractThreadPool { return threads_.size(); } - const std::vector<ThreadPoolWorker*>& GetWorkers(); + EXPORT const std::vector<ThreadPoolWorker*>& GetWorkers(); // Broadcast to the workers and tell them to empty out the work queue. - void StartWorkers(Thread* self) REQUIRES(!task_queue_lock_); + EXPORT void StartWorkers(Thread* self) REQUIRES(!task_queue_lock_); // Do not allow workers to grab any new tasks. - void StopWorkers(Thread* self) REQUIRES(!task_queue_lock_); + EXPORT void StopWorkers(Thread* self) REQUIRES(!task_queue_lock_); // Returns if the thread pool has started. bool HasStarted(Thread* self) REQUIRES(!task_queue_lock_); @@ -136,7 +137,7 @@ class AbstractThreadPool { virtual size_t GetTaskCount(Thread* self) REQUIRES(!task_queue_lock_) = 0; // Create the threads of this pool. - void CreateThreads(); + EXPORT void CreateThreads(); // Stops and deletes all threads in this pool. void DeleteThreads(); @@ -144,7 +145,7 @@ class AbstractThreadPool { // Wait for all tasks currently on queue to get completed. If the pool has been stopped, only // wait till all already running tasks are done. // When the pool was created with peers for workers, do_work must not be true (see ThreadPool()). - void Wait(Thread* self, bool do_work, bool may_hold_locks) REQUIRES(!task_queue_lock_); + EXPORT void Wait(Thread* self, bool do_work, bool may_hold_locks) REQUIRES(!task_queue_lock_); // Returns the total amount of workers waited for tasks. uint64_t GetWaitTime() const { @@ -182,10 +183,10 @@ class AbstractThreadPool { virtual bool HasOutstandingTasks() const REQUIRES(task_queue_lock_) = 0; - AbstractThreadPool(const char* name, - size_t num_threads, - bool create_peers, - size_t worker_stack_size); + EXPORT AbstractThreadPool(const char* name, + size_t num_threads, + bool create_peers, + size_t worker_stack_size); const std::string name_; Mutex task_queue_lock_; @@ -210,7 +211,7 @@ class AbstractThreadPool { DISALLOW_COPY_AND_ASSIGN(AbstractThreadPool); }; -class ThreadPool : public AbstractThreadPool { +class EXPORT ThreadPool : public AbstractThreadPool { public: // Create a named thread pool with the given number of threads. // diff --git a/runtime/thread_pool_test.cc b/runtime/thread_pool_test.cc index db2cef0273..33b7f5b52b 100644 --- a/runtime/thread_pool_test.cc +++ b/runtime/thread_pool_test.cc @@ -23,7 +23,7 @@ #include "scoped_thread_state_change-inl.h" #include "thread-inl.h" -namespace art { +namespace art HIDDEN { class CountTask : public Task { public: diff --git a/runtime/thread_state.h b/runtime/thread_state.h index e03df2752c..120f72e396 100644 --- a/runtime/thread_state.h +++ b/runtime/thread_state.h @@ -19,7 +19,9 @@ #include <iosfwd> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { // State stored in our C++ class Thread. // When we refer to "a suspended state", or when function names mention "ToSuspended" or @@ -63,7 +65,7 @@ enum class ThreadState : uint8_t { kNative, // RUNNABLE TS_RUNNING running in a JNI native method kSuspended, // RUNNABLE TS_RUNNING suspended by GC or debugger }; -std::ostream& operator<<(std::ostream& os, ThreadState rhs); +EXPORT std::ostream& operator<<(std::ostream& os, ThreadState rhs); } // namespace art diff --git a/runtime/ti/agent.cc b/runtime/ti/agent.cc index cdfe727e50..b5607273ed 100644 --- a/runtime/ti/agent.cc +++ b/runtime/ti/agent.cc @@ -27,7 +27,7 @@ #include "thread-current-inl.h" #include "scoped_thread_state_change-inl.h" -namespace art { +namespace art HIDDEN { namespace ti { using android::base::StringPrintf; diff --git a/runtime/ti/agent.h b/runtime/ti/agent.h index 598c8ffe57..5d4cf50970 100644 --- a/runtime/ti/agent.h +++ b/runtime/ti/agent.h @@ -25,7 +25,9 @@ #include <android-base/logging.h> #include <android-base/macros.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { namespace ti { class Agent; diff --git a/runtime/trace.cc b/runtime/trace.cc index 0eae5d00c6..1ccbd5496f 100644 --- a/runtime/trace.cc +++ b/runtime/trace.cc @@ -51,7 +51,7 @@ #include "thread.h" #include "thread_list.h" -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/trace.h b/runtime/trace.h index 914ea4b79b..a55816aec4 100644 --- a/runtime/trace.h +++ b/runtime/trace.h @@ -40,7 +40,7 @@ namespace unix_file { class FdFile; } // namespace unix_file -namespace art { +namespace art HIDDEN { class ArtField; class ArtMethod; diff --git a/runtime/transaction.cc b/runtime/transaction.cc index f22d71f92d..bc6651633d 100644 --- a/runtime/transaction.cc +++ b/runtime/transaction.cc @@ -35,7 +35,7 @@ #include <list> -namespace art { +namespace art HIDDEN { // TODO: remove (only used for debugging purpose). static constexpr bool kEnableTransactionStats = false; diff --git a/runtime/transaction.h b/runtime/transaction.h index 6fa8e5861c..9f3282f8d9 100644 --- a/runtime/transaction.h +++ b/runtime/transaction.h @@ -30,7 +30,7 @@ #include <list> #include <map> -namespace art { +namespace art HIDDEN { namespace gc { class Heap; } // namespace gc diff --git a/runtime/transaction_test.cc b/runtime/transaction_test.cc index 62ee08810a..c4eb7e808b 100644 --- a/runtime/transaction_test.cc +++ b/runtime/transaction_test.cc @@ -25,7 +25,7 @@ #include "mirror/class-alloc-inl.h" #include "scoped_thread_state_change-inl.h" -namespace art { +namespace art HIDDEN { class TransactionTest : public CommonRuntimeTest { protected: diff --git a/runtime/two_runtimes_test.cc b/runtime/two_runtimes_test.cc index b52f66afb2..a82742668d 100644 --- a/runtime/two_runtimes_test.cc +++ b/runtime/two_runtimes_test.cc @@ -19,7 +19,7 @@ #include "scoped_thread_state_change-inl.h" #include "thread.h" -namespace art { +namespace art HIDDEN { // This test creates two runtimes consecutively to check that state is // setup and cleaned-up correctly each time. |