diff options
author | 2018-02-20 10:11:01 -0800 | |
---|---|---|
committer | 2018-02-20 10:11:01 -0800 | |
commit | 14300f121c9526960af124d8a2618652f4b589db (patch) | |
tree | 5aab0e1c6d20c515638b8c7f1e411fa6017d9af1 | |
parent | 4258f11d88a4da003377354c40a81e5f786e25c8 (diff) |
Fix one Linux-specific test
-rw-r--r-- | test/core/iomgr/ev_epollsig_linux_test.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/core/iomgr/ev_epollsig_linux_test.cc b/test/core/iomgr/ev_epollsig_linux_test.cc index 751b80fa89..0bb1499f90 100644 --- a/test/core/iomgr/ev_epollsig_linux_test.cc +++ b/test/core/iomgr/ev_epollsig_linux_test.cc @@ -259,9 +259,10 @@ static void test_threading(void) { shared.pollset = static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size())); grpc_pollset_init(shared.pollset, &shared.mu); - gpr_thd_id thds[10]; - for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) { - gpr_thd_new(&thds[i], "test_thread", test_threading_loop, &shared); + grpc_core::Thread thds[10]; + for (auto& th: thds) { + new (&th) grpc_core::Thread("test_thread", test_threading_loop, &shared); + th.Start(); } grpc_wakeup_fd fd; GPR_ASSERT(GRPC_LOG_IF_ERROR("wakeup_fd_init", grpc_wakeup_fd_init(&fd))); @@ -278,8 +279,8 @@ static void test_threading(void) { } GPR_ASSERT(GRPC_LOG_IF_ERROR("wakeup_first", grpc_wakeup_fd_wakeup(shared.wakeup_fd))); - for (size_t i = 0; i < GPR_ARRAY_SIZE(thds); i++) { - gpr_thd_join(thds[i]); + for (auto& th: thds) { + th.Join(); } fd.read_fd = 0; grpc_wakeup_fd_destroy(&fd); |