diff options
Diffstat (limited to 'include/grpc/support/tls_gcc.h')
-rw-r--r-- | include/grpc/support/tls_gcc.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/grpc/support/tls_gcc.h b/include/grpc/support/tls_gcc.h index 019acdf122..170baf82ca 100644 --- a/include/grpc/support/tls_gcc.h +++ b/include/grpc/support/tls_gcc.h @@ -37,6 +37,10 @@ struct gpr_gcc_thread_local { static bool name##_inited = false; \ static __thread struct gpr_gcc_thread_local name = {0, &(name##_inited)} +#define GPR_TLS_NON_STATIC_DECL(name) \ + bool name##_inited = false; \ + __thread struct gpr_gcc_thread_local name = {0, &(name##_inited)} + #define gpr_tls_init(tls) \ do { \ GPR_ASSERT(*((tls)->inited) == false); \ @@ -71,6 +75,9 @@ struct gpr_gcc_thread_local { #define GPR_TLS_DECL(name) \ static __thread struct gpr_gcc_thread_local name = {0} +#define GPR_TLS_NON_STATIC_DECL(name) \ + __thread struct gpr_gcc_thread_local name = {0} + #define gpr_tls_init(tls) \ do { \ } while (0) |