19 #ifndef MIR_DISPATCH_MULTIPLEXING_DISPATCHABLE_H_ 20 #define MIR_DISPATCH_MULTIPLEXING_DISPATCHABLE_H_ 25 #include <initializer_list> 62 Fd watch_fd()
const override;
63 bool dispatch(
FdEvents events)
override;
64 FdEvents relevant_events()
const override;
71 void add_watch(std::shared_ptr<Dispatchable>
const& dispatchee);
75 void add_watch(std::shared_ptr<Dispatchable>
const& dispatchee,
DispatchReentrancy reentrancy);
83 void add_watch(
Fd const& fd, std::function<
void()>
const& callback);
89 void remove_watch(std::shared_ptr<Dispatchable>
const& dispatchee);
95 void remove_watch(
Fd const& fd);
97 pthread_rwlock_t lifetime_mutex;
98 std::list<std::pair<std::shared_ptr<Dispatchable>,
bool>> dispatchee_holder;
104 #endif // MIR_DISPATCH_MULTIPLEXING_DISPATCHABLE_H_ All things Mir.
Definition: atomic_callback.h:25
DispatchReentrancy
How concurrent dispatch should be handled.
Definition: multiplexing_dispatchable.h:38
An adaptor that combines multiple Dispatchables into a single Dispatchable.
Definition: multiplexing_dispatchable.h:52
The dispatch function may be called on multiple threads simultaneously.
Definition: dispatchable.h:38
uint32_t FdEvents
Definition: dispatchable.h:36
The dispatch function is guaranteed not to be called while a thread is currently running it...