c11: Implement thread_local in c11/threads.h
Use thread_local when possible Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15087>
This commit is contained in:
+3
-5
@@ -79,13 +79,11 @@
|
||||
* expensive pthread_getspecific() or its equivalent).
|
||||
*/
|
||||
#ifdef USE_ELF_TLS
|
||||
#ifdef _MSC_VER
|
||||
#define __THREAD_INITIAL_EXEC __declspec(thread)
|
||||
#elif defined(__GLIBC__)
|
||||
#define __THREAD_INITIAL_EXEC __thread __attribute__((tls_model("initial-exec")))
|
||||
#if defined(__GLIBC__)
|
||||
#define __THREAD_INITIAL_EXEC thread_local __attribute__((tls_model("initial-exec")))
|
||||
#define REALLY_INITIAL_EXEC
|
||||
#else
|
||||
#define __THREAD_INITIAL_EXEC __thread
|
||||
#define __THREAD_INITIAL_EXEC thread_local
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user