aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib
diff options
context:
space:
mode:
authorGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2017-05-26 00:32:47 +0200
committerGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2017-05-26 00:32:47 +0200
commit7bc55fdaa30c7de1609a276c5b1d110d4949e414 (patch)
tree16c4ae13bcaaa46f79344762d14bf2f918f6e894 /src/core/lib
parent5a1d197f1ced4ed9f64a3816ac48e89d4c7687f6 (diff)
parent840931eec9bfd95c2d69f6b1e60413d18dd8281e (diff)
Merge remote-tracking branch 'ctiller/build-wtf' into import
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);