diff options
-rw-r--r-- | include/grpc/impl/codegen/port_platform.h | 6 | ||||
-rw-r--r-- | test/cpp/microbenchmarks/bm_fullstack_trickle.cc | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h index e84a75d295..5bbab70c6a 100644 --- a/include/grpc/impl/codegen/port_platform.h +++ b/include/grpc/impl/codegen/port_platform.h @@ -409,4 +409,10 @@ typedef unsigned __int64 uint64_t; #define CENSUSAPI GRPCAPI #endif +#if defined(__has_feature) +#if __has_feature(thread_sanitizer) +#define GPR_ATTRIBUTE_NO_TSAN __attribute__((no_sanitize("thread"))) +#endif +#endif + #endif /* GRPC_IMPL_CODEGEN_PORT_PLATFORM_H */ diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc index 135b4710ce..37dd08c33d 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc @@ -105,7 +105,7 @@ class TrickledCHTTP2 : public EndpointPairFixture { (double)state.iterations()); } - void Log(int64_t iteration) { + void Log(int64_t iteration) GPR_ATTRIBUTE_NO_TSAN { auto now = gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), start_); grpc_chttp2_transport* client = reinterpret_cast<grpc_chttp2_transport*>(client_transport_); |