1 #ifndef LIBFILEZILLA_EVENT_LOOP_HEADER
2 #define LIBFILEZILLA_EVENT_LOOP_HEADER
78 void stop(
bool join =
false);
85 void resend_current_event() {
92 void FZ_PRIVATE_SYMBOL remove_handler(
event_handler* handler);
95 void FZ_PRIVATE_SYMBOL stop_timer(timer_id
id);
104 bool FZ_PRIVATE_SYMBOL process_timers(
scoped_lock & l);
106 void FZ_PRIVATE_SYMBOL entry();
107 void FZ_PRIVATE_SYMBOL timer_entry();
109 struct FZ_PRIVATE_SYMBOL timer_data final
119 typedef std::vector<timer_data> Timers;
121 typedef std::deque<std::tuple<event_handler*, event_base*, bool>> Events;
122 Events pending_events_;
131 bool active_handler_removed_{};
136 timer_id next_timer_id_{};
138 thread::id thread_id_{};
140 std::unique_ptr<thread> thread_;
141 std::unique_ptr<async_task> task_;
144 std::unique_ptr<thread> timer_thread_;
145 std::unique_ptr<async_task> timer_task_;
Spawns and represents a new thread of execution.
Definition: thread.hpp:29
Thread synchronization primitives: mutex, scoped_lock and condition.
A simple scoped lock.
Definition: mutex.hpp:116
simple_event< process_event_type, process *, process_event_flag > process_event
Definition: process.hpp:37
Definition: event_handler.hpp:60
Waitable condition variable.
Definition: mutex.hpp:233
Assorted classes dealing with time.
Definition: event.hpp:101
A threaded event loop that supports sending events and timers.
Definition: event_loop.hpp:33
A monotonic clock (aka steady clock) is independent from walltime.
Definition: time.hpp:402
The namespace used by libfilezilla.
Definition: apply.hpp:17
The duration class represents a time interval in milliseconds.
Definition: time.hpp:290
Declares event_base and simple_event<>
Template helper to call a function with its arguments extracted from a tuple.
Lean replacement for std::(recursive_)mutex.
Definition: mutex.hpp:74
A dumb thread-pool for asynchronous tasks.
Definition: thread_pool.hpp:63
Common base class for all events.
Definition: event.hpp:22