Fix workqueues, timer shutdown

pull/6897/head
Craig Tiller 9 years ago
parent cae4b1b398
commit 25dc53915b
  1. 3
      src/core/lib/iomgr/timer.c
  2. 2
      src/core/lib/iomgr/workqueue_posix.c

@ -105,7 +105,8 @@ void grpc_timer_list_init(gpr_timespec now) {
void grpc_timer_list_shutdown(grpc_exec_ctx *exec_ctx) {
int i;
run_some_expired_timers(exec_ctx, gpr_inf_future(g_clock_type), NULL, 0);
run_some_expired_timers(exec_ctx, gpr_inf_future(g_clock_type), NULL,
GRPC_ERROR_CREATE("Timer list shutdown"));
for (i = 0; i < NUM_SHARDS; i++) {
shard_type *shard = &g_shards[i];
gpr_mu_destroy(&shard->mu);

@ -62,7 +62,7 @@ grpc_error *grpc_workqueue_create(grpc_exec_ctx *exec_ctx,
sprintf(name, "workqueue:%p", (void *)(*workqueue));
(*workqueue)->wakeup_read_fd = grpc_fd_create(
GRPC_WAKEUP_FD_GET_READ_FD(&(*workqueue)->wakeup_fd), name);
grpc_closure_init(&(*workqueue)->read_closure, on_readable, workqueue);
grpc_closure_init(&(*workqueue)->read_closure, on_readable, *workqueue);
grpc_fd_notify_on_read(exec_ctx, (*workqueue)->wakeup_read_fd,
&(*workqueue)->read_closure);
return GRPC_ERROR_NONE;

Loading…
Cancel
Save