aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/gpr/cpu_test.cc
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2018-03-01 11:36:47 -0800
committerGravatar Vijay Pai <vpai@google.com>2018-03-01 11:47:36 -0800
commit2fe87b09055cd256cdce038c4c70d92b955c991b (patch)
treea7652e9285797130e4d4ece7a6f271530be4b14f /test/core/gpr/cpu_test.cc
parent8ffa1ae93310646cdf1b15c3a8c2655268d1a47f (diff)
Move assignment for Thread, make destructor optional, loop cv waits
Diffstat (limited to 'test/core/gpr/cpu_test.cc')
-rw-r--r--test/core/gpr/cpu_test.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/core/gpr/cpu_test.cc b/test/core/gpr/cpu_test.cc
index 279e6e6f5a..1052d40b42 100644
--- a/test/core/gpr/cpu_test.cc
+++ b/test/core/gpr/cpu_test.cc
@@ -25,7 +25,6 @@
#include <stdio.h>
#include <string.h>
-#include <new>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -118,7 +117,7 @@ static void cpu_test(void) {
static_cast<grpc_core::Thread*>(gpr_malloc(sizeof(*thd) * nthreads));
for (i = 0; i < nthreads; i++) {
- new (&thd[i]) grpc_core::Thread("grpc_cpu_test", &worker_thread, &ct);
+ thd[i] = grpc_core::Thread("grpc_cpu_test", &worker_thread, &ct);
thd[i].Start();
}
gpr_mu_lock(&ct.mu);
@@ -128,7 +127,6 @@ static void cpu_test(void) {
gpr_mu_unlock(&ct.mu);
for (i = 0; i < nthreads; i++) {
thd[i].Join();
- thd[i].~Thread();
}
gpr_free(thd);
fprintf(stderr, "Saw cores [");