1 // Copyright 2015 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef PARTITION_ALLOC_PARTITION_ALLOC_BASE_THREADING_PLATFORM_THREAD_INTERNAL_POSIX_H_ 6 #define PARTITION_ALLOC_PARTITION_ALLOC_BASE_THREADING_PLATFORM_THREAD_INTERNAL_POSIX_H_ 7 8 #include "build/build_config.h" 9 #include "partition_alloc/partition_alloc_base/component_export.h" 10 11 namespace partition_alloc::internal::base::internal { 12 13 #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) 14 // Current thread id is cached in thread local storage for performance reasons. 15 // In some rare cases it's important to invalidate that cache explicitly (e.g. 16 // after going through clone() syscall which does not call pthread_atfork() 17 // handlers). 18 // This can only be called when the process is single-threaded. 19 PA_COMPONENT_EXPORT(PARTITION_ALLOC_BASE) void InvalidateTidCache(); 20 #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) 21 22 } // namespace partition_alloc::internal::base::internal 23 24 #endif // PARTITION_ALLOC_PARTITION_ALLOC_BASE_THREADING_PLATFORM_THREAD_INTERNAL_POSIX_H_ 25