diff options
author | 2015-09-09 12:30:59 -0700 | |
---|---|---|
committer | 2015-09-09 12:30:59 -0700 | |
commit | 8664ca6463e8387b711f32fe283e0115e79c4c54 (patch) | |
tree | c7bacd643339d4473ddf3eb5db7cd8003d2986d3 /src/core/iomgr/iomgr.c | |
parent | 73b6606629bb65551bc804fa9e96b43ee3aa6583 (diff) |
Starting to convert code to work queues
Diffstat (limited to 'src/core/iomgr/iomgr.c')
-rw-r--r-- | src/core/iomgr/iomgr.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/core/iomgr/iomgr.c b/src/core/iomgr/iomgr.c index 1dd03992ae..cf74a16c0c 100644 --- a/src/core/iomgr/iomgr.c +++ b/src/core/iomgr/iomgr.c @@ -46,39 +46,9 @@ static gpr_mu g_mu; static gpr_cv g_rcv; -static grpc_iomgr_closure *g_cbs_head = NULL; -static grpc_iomgr_closure *g_cbs_tail = NULL; static int g_shutdown; -static gpr_event g_background_callback_executor_done; static grpc_iomgr_object g_root_object; -/* Execute followup callbacks continuously. - Other threads may check in and help during pollset_work() */ -static void background_callback_executor(void *ignored) { - gpr_mu_lock(&g_mu); - while (!g_shutdown) { - gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); - gpr_timespec short_deadline = gpr_time_add( - gpr_now(GPR_CLOCK_MONOTONIC), gpr_time_from_millis(100, GPR_TIMESPAN)); - if (g_cbs_head) { - grpc_iomgr_closure *closure = g_cbs_head; - g_cbs_head = closure->next; - if (!g_cbs_head) g_cbs_tail = NULL; - gpr_mu_unlock(&g_mu); - closure->cb(closure->cb_arg, closure->success); - gpr_mu_lock(&g_mu); - } else if (grpc_alarm_check(&g_mu, gpr_now(GPR_CLOCK_MONOTONIC), - &deadline)) { - } else { - gpr_mu_unlock(&g_mu); - gpr_sleep_until(gpr_time_min(short_deadline, deadline)); - gpr_mu_lock(&g_mu); - } - } - gpr_mu_unlock(&g_mu); - gpr_event_set(&g_background_callback_executor_done, (void *)1); -} - void grpc_kick_poller(void) { /* Empty. The background callback executor polls periodically. The activity * the kicker is trying to draw the executor's attention to will be picked up |