#include <grpc/support/port_platform.h>
#include "src/core/lib/event_engine/posix_engine/timer.h"
#include <algorithm>
#include <atomic>
#include <limits>
#include <utility>
#include <grpc/support/cpu.h>
#include "src/core/lib/event_engine/posix_engine/timer_heap.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/time.h"
namespace grpc_event_engine {
namespace experimental {
static const size_t kInvalidHeapIndex = …;
static const double kAddDeadlineScale = …;
static const double kMinQueueWindowDuration = …;
static const double kMaxQueueWindowDuration = …;
grpc_core::Timestamp TimerList::Shard::ComputeMinDeadline() { … }
TimerList::Shard::Shard() : … { … }
TimerList::TimerList(TimerListHost* host)
: … { … }
namespace {
void ListJoin(Timer* head, Timer* timer) { … }
void ListRemove(Timer* timer) { … }
}
void TimerList::SwapAdjacentShardsInQueue(uint32_t first_shard_queue_index) { … }
void TimerList::NoteDeadlineChange(Shard* shard) { … }
void TimerList::TimerInit(Timer* timer, grpc_core::Timestamp deadline,
experimental::EventEngine::Closure* closure) { … }
bool TimerList::TimerCancel(Timer* timer) { … }
bool TimerList::Shard::RefillHeap(grpc_core::Timestamp now) { … }
Timer* TimerList::Shard::PopOne(grpc_core::Timestamp now) { … }
void TimerList::Shard::PopTimers(
grpc_core::Timestamp now, grpc_core::Timestamp* new_min_deadline,
std::vector<experimental::EventEngine::Closure*>* out) { … }
std::vector<experimental::EventEngine::Closure*> TimerList::FindExpiredTimers(
grpc_core::Timestamp now, grpc_core::Timestamp* next) { … }
absl::optional<std::vector<experimental::EventEngine::Closure*>>
TimerList::TimerCheck(grpc_core::Timestamp* next) { … }
}
}