diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h b/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h index 38de98245084..84d08b5c520d 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h @@ -73,24 +73,6 @@ class ThreadContextBase { typedef ThreadContextBase* (*ThreadContextFactory)(u32 tid); class ThreadRegistry { - private: - const ThreadContextFactory context_factory_; - const u32 max_threads_; - const u32 thread_quarantine_size_; - - BlockingMutex mtx_; - - u32 n_contexts_; // Number of created thread contexts, - // at most max_threads_. - u64 total_threads_; // Total number of created threads. May be greater than - // max_threads_ if contexts were reused. - uptr alive_threads_; // Created or running. - uptr max_alive_threads_; - uptr running_threads_; - - ThreadContextBase **threads_; // Array of thread contexts is leaked. - IntrusiveList dead_threads_; - public: static const u32 kUnknownTid; @@ -130,6 +112,24 @@ class ThreadRegistry { void JoinThread(u32 tid, void *arg); void FinishThread(u32 tid); void StartThread(u32 tid, uptr os_id, void *arg); + + private: + const ThreadContextFactory context_factory_; + const u32 max_threads_; + const u32 thread_quarantine_size_; + + BlockingMutex mtx_; + + u32 n_contexts_; // Number of created thread contexts, + // at most max_threads_. + u64 total_threads_; // Total number of created threads. May be greater than + // max_threads_ if contexts were reused. + uptr alive_threads_; // Created or running. + uptr max_alive_threads_; + uptr running_threads_; + + ThreadContextBase **threads_; // Array of thread contexts is leaked. + IntrusiveList dead_threads_; }; typedef GenericScopedLock ThreadRegistryLock; diff --git a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt index 74f08c569346..3e60afe9f83d 100644 --- a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt +++ b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt @@ -56,7 +56,9 @@ macro(add_sanitizer_tests_for_arch arch) -I${COMPILER_RT_SOURCE_DIR}/include -I${COMPILER_RT_SOURCE_DIR}/lib -I${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common - -O2 -g -Wall -Werror -Werror=sign-compare ${TARGET_FLAGS}) + -DGTEST_HAS_RTTI=0 + -O2 -g -fno-rtti + -Wall -Werror -Werror=sign-compare ${TARGET_FLAGS}) set(SANITIZER_TEST_LINK_FLAGS -lstdc++ -lpthread -ldl ${TARGET_FLAGS}) set(SANITIZER_TEST_OBJECTS) foreach(source ${SANITIZER_TEST_SOURCES})