diff options
author | 2018-03-01 11:36:47 -0800 | |
---|---|---|
committer | 2018-03-01 11:47:36 -0800 | |
commit | 2fe87b09055cd256cdce038c4c70d92b955c991b (patch) | |
tree | a7652e9285797130e4d4ece7a6f271530be4b14f /test/core/gpr/mpscq_test.cc | |
parent | 8ffa1ae93310646cdf1b15c3a8c2655268d1a47f (diff) |
Move assignment for Thread, make destructor optional, loop cv waits
Diffstat (limited to 'test/core/gpr/mpscq_test.cc')
-rw-r--r-- | test/core/gpr/mpscq_test.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/core/gpr/mpscq_test.cc b/test/core/gpr/mpscq_test.cc index 1e929fcf33..8c0873941f 100644 --- a/test/core/gpr/mpscq_test.cc +++ b/test/core/gpr/mpscq_test.cc @@ -19,7 +19,6 @@ #include "src/core/lib/gpr/mpscq.h" #include <stdlib.h> -#include <new> #include <grpc/support/alloc.h> #include <grpc/support/log.h> @@ -85,7 +84,7 @@ static void test_mt(void) { ta[i].ctr = 0; ta[i].q = &q; ta[i].start = &start; - new (&thds[i]) grpc_core::Thread("grpc_mt_test", test_thread, &ta[i]); + thds[i] = grpc_core::Thread("grpc_mt_test", test_thread, &ta[i]); thds[i].Start(); } size_t num_done = 0; @@ -155,7 +154,7 @@ static void test_mt_multipop(void) { ta[i].ctr = 0; ta[i].q = &q; ta[i].start = &start; - new (&thds[i]) grpc_core::Thread("grpc_multipop_test", test_thread, &ta[i]); + thds[i] = grpc_core::Thread("grpc_multipop_test", test_thread, &ta[i]); thds[i].Start(); } pull_args pa; @@ -167,8 +166,7 @@ static void test_mt_multipop(void) { pa.start = &start; gpr_mu_init(&pa.mu); for (size_t i = 0; i < GPR_ARRAY_SIZE(pull_thds); i++) { - new (&pull_thds[i]) - grpc_core::Thread("grpc_multipop_pull", pull_thread, &pa); + pull_thds[i] = grpc_core::Thread("grpc_multipop_pull", pull_thread, &pa); pull_thds[i].Start(); } gpr_event_set(&start, (void*)1); |