diff options
author | Vijay Pai <vpai@google.com> | 2018-03-01 11:36:47 -0800 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2018-03-01 11:47:36 -0800 |
commit | 2fe87b09055cd256cdce038c4c70d92b955c991b (patch) | |
tree | a7652e9285797130e4d4ece7a6f271530be4b14f /test/core/surface/concurrent_connectivity_test.cc | |
parent | 8ffa1ae93310646cdf1b15c3a8c2655268d1a47f (diff) |
Move assignment for Thread, make destructor optional, loop cv waits
Diffstat (limited to 'test/core/surface/concurrent_connectivity_test.cc')
-rw-r--r-- | test/core/surface/concurrent_connectivity_test.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/test/core/surface/concurrent_connectivity_test.cc b/test/core/surface/concurrent_connectivity_test.cc index 32b4ae1da8..c1298b6636 100644 --- a/test/core/surface/concurrent_connectivity_test.cc +++ b/test/core/surface/concurrent_connectivity_test.cc @@ -24,7 +24,6 @@ #include <memory.h> #include <stdio.h> -#include <new> #include <grpc/grpc.h> #include <grpc/support/alloc.h> @@ -179,8 +178,7 @@ int run_concurrent_connectivity_test() { char* localhost = gpr_strdup("localhost:54321"); grpc_core::Thread threads[NUM_THREADS]; for (auto& th : threads) { - new (&th) - grpc_core::Thread("grpc_wave_1", create_loop_destroy, localhost); + th = grpc_core::Thread("grpc_wave_1", create_loop_destroy, localhost); th.Start(); } for (auto& th : threads) { @@ -204,8 +202,7 @@ int run_concurrent_connectivity_test() { grpc_core::Thread threads[NUM_THREADS]; for (auto& th : threads) { - new (&th) - grpc_core::Thread("grpc_wave_2", create_loop_destroy, args.addr); + th = grpc_core::Thread("grpc_wave_2", create_loop_destroy, args.addr); th.Start(); } for (auto& th : threads) { @@ -231,8 +228,7 @@ int run_concurrent_connectivity_test() { grpc_core::Thread threads[NUM_THREADS]; for (auto& th : threads) { - new (&th) - grpc_core::Thread("grpc_wave_3", create_loop_destroy, args.addr); + th = grpc_core::Thread("grpc_wave_3", create_loop_destroy, args.addr); th.Start(); } for (auto& th : threads) { @@ -291,8 +287,8 @@ int run_concurrent_watches_with_short_timeouts_test() { char* localhost = gpr_strdup("localhost:54321"); for (auto& th : threads) { - new (&th) grpc_core::Thread("grpc_short_watches", - watches_with_short_timeouts, localhost); + th = grpc_core::Thread("grpc_short_watches", watches_with_short_timeouts, + localhost); th.Start(); } for (auto& th : threads) { |