diff options
author | Dave MacLachlan <dmaclach@gmail.com> | 2017-11-29 16:25:10 -0800 |
---|---|---|
committer | Dave MacLachlan <dmaclach@gmail.com> | 2017-11-29 16:25:10 -0800 |
commit | af5c54de9cdf3a8ac27aa428571d98a93f32cc1f (patch) | |
tree | 5ba4015c5d815aa9652efe44e95d6afd9b430090 /include/grpc/impl/codegen/port_platform.h | |
parent | c99a3ca415fcf5581f9c365e4dc3004e858fc76a (diff) |
Add thread naming support on platforms that support it.
As a client of grpc I want to be aware of which threads are being
created by grpc, and giving them recognizable names makes it significantly
easier to diagnose what is going on in my programs.
This provides thread names for macOS and Linux. Adding support for other
platforms should be easy for platform specialists.
Diffstat (limited to 'include/grpc/impl/codegen/port_platform.h')
-rw-r--r-- | include/grpc/impl/codegen/port_platform.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index 1906886d5e..0c87aef27d 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -166,6 +166,7 @@ #define GPR_POSIX_SYNC 1 #define GPR_POSIX_TIME 1 #define GPR_GETPID_IN_UNISTD_H 1 +#define GPR_LINUX_PTHREAD_NAME 1 #ifdef _LP64 #define GPR_ARCH_64 1 #else /* _LP64 */ @@ -195,6 +196,7 @@ #else /* __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_7 */ #define GPR_CPU_POSIX 1 #define GPR_GCC_TLS 1 +#define GPR_APPLE_PTHREAD_NAME 1 #endif #else /* __MAC_OS_X_VERSION_MIN_REQUIRED */ #define GPR_CPU_POSIX 1 @@ -236,6 +238,7 @@ #define GPR_POSIX_TIME 1 #define GPR_GETPID_IN_UNISTD_H 1 #define GPR_SUPPORT_CHANNELS_FROM_FD 1 +#define GPR_BSD_PTHREAD_NAME 1 #ifdef _LP64 #define GPR_ARCH_64 1 #else /* _LP64 */ |