79 void stop(
bool join =
false);
94 friend class event_handler;
96 void FZ_PRIVATE_SYMBOL remove_handler(event_handler* handler);
98 timer_id FZ_PRIVATE_SYMBOL add_timer(event_handler* handler,
monotonic_clock const& deadline,
duration const& interval);
99 void FZ_PRIVATE_SYMBOL stop_timer(timer_id
id);
100 timer_id FZ_PRIVATE_SYMBOL stop_add_timer(timer_id
id, event_handler* handler,
monotonic_clock const& deadline,
duration const& interval);
102 void send_event(event_handler* handler,
event_base* evt,
bool deletable);
105 bool FZ_PRIVATE_SYMBOL process_event(
scoped_lock & l);
108 bool FZ_PRIVATE_SYMBOL process_timers(
scoped_lock & l);
110 void FZ_PRIVATE_SYMBOL entry();
111 void FZ_PRIVATE_SYMBOL timer_entry();
113 struct FZ_PRIVATE_SYMBOL timer_data final
115 event_handler* handler_{};
117 monotonic_clock deadline_;
118 duration interval_{};
121 timer_id FZ_PRIVATE_SYMBOL setup_timer(scoped_lock &lock, timer_data &d, event_handler* handler, monotonic_clock
const& deadline, duration
const& interval);
123 typedef std::vector<timer_data> Timers;
125 typedef std::deque<std::tuple<event_handler*, event_base*, bool>> Events;
126 Events pending_events_;
132 condition timer_cond_;
135 bool active_handler_removed_{};
136 event_handler * active_handler_{};
138 monotonic_clock deadline_;
139 size_t deadline_index_{};
141 timer_id next_timer_id_{};
143 thread::id thread_id_{};
145 std::unique_ptr<thread> thread_;
146 std::unique_ptr<async_task> task_;
148 thread_pool* pool_{};
149 std::unique_ptr<thread> timer_thread_;
150 std::unique_ptr<async_task> timer_task_;