util: Add a helper macro for defining initial-exec variables.

I'm going to add another case for Android shortly, and then we can keep
the logic all in one spot.

Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10389>
This commit is contained in:
Emma Anholt
2021-05-21 13:23:07 -07:00
committed by Marge Bot
parent 4a68b16a52
commit 75a9cb1033
7 changed files with 28 additions and 25 deletions

View File

@@ -32,6 +32,7 @@
#include <stdarg.h>
#include "c99_compat.h"
#include "c11/threads.h"
#include "util/u_thread.h"
#include "egllog.h"
#include "eglcurrent.h"
@@ -45,8 +46,7 @@ static tss_t _egl_TSD;
static void _eglDestroyThreadInfo(_EGLThreadInfo *t);
#ifdef USE_ELF_TLS
static __thread const _EGLThreadInfo *_egl_TLS
__attribute__ ((tls_model("initial-exec")));
static __THREAD_INITIAL_EXEC const _EGLThreadInfo *_egl_TLS;
#endif
static inline void _eglSetTSD(const _EGLThreadInfo *t)