From b550df976775189012fcbb396694658c93993620 Mon Sep 17 00:00:00 2001 From: Yifan Zhu Date: Fri, 2 Aug 2024 12:15:57 -0700 Subject: [PATCH] [libc] inline thread self --- libc/src/__support/threads/thread.cpp | 3 --- libc/src/__support/threads/thread.h | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/libc/src/__support/threads/thread.cpp b/libc/src/__support/threads/thread.cpp index 886281e0d50f78..dad4f75f092ede 100644 --- a/libc/src/__support/threads/thread.cpp +++ b/libc/src/__support/threads/thread.cpp @@ -17,9 +17,6 @@ #include "src/__support/macros/attributes.h" namespace LIBC_NAMESPACE_DECL { - -LIBC_THREAD_LOCAL Thread self; - namespace { using AtExitCallback = void(void *); diff --git a/libc/src/__support/threads/thread.h b/libc/src/__support/threads/thread.h index 68640cef329643..f2b1f6bbb253db 100644 --- a/libc/src/__support/threads/thread.h +++ b/libc/src/__support/threads/thread.h @@ -231,7 +231,7 @@ struct Thread { int get_name(cpp::StringStream &name) const; }; -extern LIBC_THREAD_LOCAL Thread self; +LIBC_INLINE_VAR LIBC_THREAD_LOCAL Thread self; // Platforms should implement this function. [[noreturn]] void thread_exit(ThreadReturnValue retval, ThreadStyle style);