libcamera: event_dispatcher: Add interrupt() function
The new interrupt() function allows interrupting in-progress blocking processEvents() calls. This is useful to stop running event loops. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
@@ -31,6 +31,7 @@ public:
|
||||
void unregisterTimer(Timer *timer);
|
||||
|
||||
void processEvents();
|
||||
void interrupt();
|
||||
|
||||
private:
|
||||
struct EventNotifierSetPoll {
|
||||
@@ -40,8 +41,10 @@ private:
|
||||
|
||||
std::map<int, EventNotifierSetPoll> notifiers_;
|
||||
std::list<Timer *> timers_;
|
||||
int eventfd_;
|
||||
|
||||
int poll(std::vector<struct pollfd> *pollfds);
|
||||
void processInterrupt(const struct pollfd &pfd);
|
||||
void processNotifiers(const std::vector<struct pollfd> &pollfds);
|
||||
void processTimers();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user