Fix timer init

pull/6160/head
Craig Tiller 9 years ago
parent 3f72df9999
commit 317f68e5b2
  1. 5
      src/core/lib/iomgr/timer.c

@ -70,6 +70,7 @@ static gpr_clock_type g_clock_type;
static shard_type g_shards[NUM_SHARDS]; static shard_type g_shards[NUM_SHARDS];
/* Protected by g_mu */ /* Protected by g_mu */
static shard_type *g_shard_queue[NUM_SHARDS]; static shard_type *g_shard_queue[NUM_SHARDS];
static bool g_initialized = false;
static int run_some_expired_timers(grpc_exec_ctx *exec_ctx, gpr_timespec now, static int run_some_expired_timers(grpc_exec_ctx *exec_ctx, gpr_timespec now,
gpr_timespec *next, int success); gpr_timespec *next, int success);
@ -183,12 +184,12 @@ void grpc_timer_init(grpc_exec_ctx *exec_ctx, grpc_timer *timer,
timer->triggered = 0; timer->triggered = 0;
if (!g_initialized) { if (!g_initialized) {
grpc_exec_ctx_enqueue(exec_ctx, &timer->closure, false); grpc_exec_ctx_enqueue(exec_ctx, &timer->closure, false, NULL);
return; return;
} }
if (gpr_time_cmp(deadline, now) <= 0) { if (gpr_time_cmp(deadline, now) <= 0) {
grpc_exec_ctx_enqueue(exec_ctx, &timer->closure, true); grpc_exec_ctx_enqueue(exec_ctx, &timer->closure, true, NULL);
return; return;
} }

Loading…
Cancel
Save