diff --git a/src/core/iomgr/alarm.c b/src/core/iomgr/alarm.c index 5b80368e3a2dbe70bf5ece449eaf6de0ee67fb5f..7884b21a1e28c8783c661a61b49610a14e31a6f4 100644 --- a/src/core/iomgr/alarm.c +++ b/src/core/iomgr/alarm.c @@ -335,10 +335,6 @@ static int run_some_expired_alarms(gpr_mu *drop_mu, gpr_timespec now, gpr_mu_unlock(&g_mu); gpr_mu_unlock(&g_checker_mu); - } else if (next) { - gpr_mu_lock(&g_mu); - *next = gpr_time_min(*next, g_shard_queue[0]->min_deadline); - gpr_mu_unlock(&g_mu); } if (n && drop_mu) { diff --git a/src/core/iomgr/alarm_internal.h b/src/core/iomgr/alarm_internal.h index 5c6b869302e452a1ac20b0ed5e9beb136a6a1739..8503292fd1adfe7e3dc961445a14dc6419c7551d 100644 --- a/src/core/iomgr/alarm_internal.h +++ b/src/core/iomgr/alarm_internal.h @@ -39,6 +39,15 @@ /* iomgr internal api for dealing with alarms */ +/* Check for alarms to be run, and run them. + Return non zero if alarm callbacks were executed. + Drops drop_mu if it is non-null before executing callbacks. + If next is non-null, TRY to update *next with the next running alarm + IF that alarm occurs before *next current value. + *next is never guaranteed to be updated on any given execution; however, + with high probability at least one thread in the system will see an update + at any time slice. */ + int grpc_alarm_check(gpr_mu *drop_mu, gpr_timespec now, gpr_timespec *next); void grpc_alarm_list_init(gpr_timespec now);