diff options
author | Yash Tibrewal <yashkt@google.com> | 2017-11-21 19:38:09 -0800 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2017-11-21 19:38:09 -0800 |
commit | a13a8c0f3ea9bdf70680c0c8b5667186c832a412 (patch) | |
tree | 399711ebc0b87ac658c1a5c5cad0c58b9012fbe8 /include/grpc/support | |
parent | 7486144de0577e3e9453feec328741180d1f1bfa (diff) |
A few src/core fixes due to missing exec_ctx_finish
Diffstat (limited to 'include/grpc/support')
-rw-r--r-- | include/grpc/support/tls_gcc.h | 7 | ||||
-rw-r--r-- | include/grpc/support/tls_msvc.h | 3 | ||||
-rw-r--r-- | include/grpc/support/tls_pthread.h | 1 |
3 files changed, 11 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) diff --git a/include/grpc/support/tls_msvc.h b/include/grpc/support/tls_msvc.h index e5f2205fc1..e3a0921912 100644 --- a/include/grpc/support/tls_msvc.h +++ b/include/grpc/support/tls_msvc.h @@ -29,6 +29,9 @@ struct gpr_msvc_thread_local { #define GPR_TLS_DECL(name) \ static __declspec(thread) struct gpr_msvc_thread_local name = {0} +#define GPR_TLS_NON_STATIC_DECL(name) \ + __declspec(thread) struct gpr_msvc_thread_local name = {0} + #define gpr_tls_init(tls) \ do { \ } while (0) diff --git a/include/grpc/support/tls_pthread.h b/include/grpc/support/tls_pthread.h index fb0edd8e74..09768d8423 100644 --- a/include/grpc/support/tls_pthread.h +++ b/include/grpc/support/tls_pthread.h @@ -30,6 +30,7 @@ struct gpr_pthread_thread_local { }; #define GPR_TLS_DECL(name) static struct gpr_pthread_thread_local name = {0} +#define GPR_TLS_NON_STATIC_DECL(name) struct gpr_pthread_thread_local name = {0} #define gpr_tls_init(tls) GPR_ASSERT(0 == pthread_key_create(&(tls)->key, NULL)) #define gpr_tls_destroy(tls) pthread_key_delete((tls)->key) |