aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-05-19 15:37:45 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-05-19 15:37:45 -0700
commit840931eec9bfd95c2d69f6b1e60413d18dd8281e (patch)
treee72a773271b5561b5339769e91c0f97f02e7aaea /src/core/lib
parenta753371f05dd116df3f27a18eb6e08e1ed0c1b4f (diff)
More import fixes
Diffstat (limited to 'src/core/lib')
-rw-r--r--src/core/lib/iomgr/timer_manager.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/lib/iomgr/timer_manager.c b/src/core/lib/iomgr/timer_manager.c
index 24085093e7..fd9a7a2f04 100644
--- a/src/core/lib/iomgr/timer_manager.c
+++ b/src/core/lib/iomgr/timer_manager.c
@@ -93,10 +93,10 @@ static void start_timer_thread_and_unlock(void) {
if (GRPC_TRACER_ON(grpc_timer_check_trace)) {
gpr_log(GPR_DEBUG, "Spawn timer thread");
}
- gpr_thd_id thd;
gpr_thd_options opt = gpr_thd_options_default();
gpr_thd_options_set_joinable(&opt);
- gpr_thd_new(&thd, timer_thread, NULL, &opt);
+ completed_thread *ct = gpr_malloc(sizeof(*ct));
+ gpr_thd_new(&ct->t, timer_thread, ct, &opt);
}
void grpc_timer_manager_tick() {
@@ -107,7 +107,7 @@ void grpc_timer_manager_tick() {
grpc_exec_ctx_finish(&exec_ctx);
}
-static void timer_thread(void *unused) {
+static void timer_thread(void *completed_thread_ptr) {
// this threads exec_ctx: we try to run things through to completion here
// since it's easy to spin up new threads
grpc_exec_ctx exec_ctx =
@@ -194,8 +194,7 @@ static void timer_thread(void *unused) {
if (0 == g_thread_count) {
gpr_cv_signal(&g_cv_shutdown);
}
- completed_thread *ct = gpr_malloc(sizeof(*ct));
- ct->t = gpr_thd_currentid();
+ completed_thread *ct = completed_thread_ptr;
ct->next = g_completed_threads;
g_completed_threads = ct;
gpr_mu_unlock(&g_mu);