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/gprpp | |
parent | 8ffa1ae93310646cdf1b15c3a8c2655268d1a47f (diff) |
Move assignment for Thread, make destructor optional, loop cv waits
Diffstat (limited to 'test/core/gprpp')
-rw-r--r-- | test/core/gprpp/thd_test.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/core/gprpp/thd_test.cc b/test/core/gprpp/thd_test.cc index a126784e72..82dd681049 100644 --- a/test/core/gprpp/thd_test.cc +++ b/test/core/gprpp/thd_test.cc @@ -22,7 +22,6 @@ #include <stdio.h> #include <stdlib.h> -#include <new> #include <grpc/support/log.h> #include <grpc/support/sync.h> @@ -60,7 +59,7 @@ static void test1(void) { t.n = NUM_THREADS; t.is_done = 0; for (auto& th : thds) { - new (&th) grpc_core::Thread("grpc_thread_body1_test", &thd_body1, &t); + th = grpc_core::Thread("grpc_thread_body1_test", &thd_body1, &t); th.Start(); } gpr_mu_lock(&t.mu); @@ -81,8 +80,7 @@ static void test2(void) { grpc_core::Thread thds[NUM_THREADS]; for (auto& th : thds) { bool ok; - new (&th) - grpc_core::Thread("grpc_thread_body2_test", &thd_body2, nullptr, &ok); + th = grpc_core::Thread("grpc_thread_body2_test", &thd_body2, nullptr, &ok); GPR_ASSERT(ok); th.Start(); } |