aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc/impl/codegen/port_platform.h
diff options
context:
space:
mode:
authorGravatar Dave MacLachlan <dmaclach@gmail.com>2017-11-29 16:25:10 -0800
committerGravatar Dave MacLachlan <dmaclach@gmail.com>2017-11-29 16:25:10 -0800
commitaf5c54de9cdf3a8ac27aa428571d98a93f32cc1f (patch)
tree5ba4015c5d815aa9652efe44e95d6afd9b430090 /include/grpc/impl/codegen/port_platform.h
parentc99a3ca415fcf5581f9c365e4dc3004e858fc76a (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.h3
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 */