diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-01-23 10:04:23 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-01-23 18:51:56 +0200 |
commit | 4d470eb37fe31cc9899ee36e81134b35b02a36f3 (patch) | |
tree | 552ed084bb00b42df90a7590db25e5bb8a2d4df8 /src/libcamera/include/event_dispatcher_poll.h | |
parent | d370c1b46e1733905fd76eec004be26475afae9d (diff) |
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>
Diffstat (limited to 'src/libcamera/include/event_dispatcher_poll.h')
-rw-r--r-- | src/libcamera/include/event_dispatcher_poll.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libcamera/include/event_dispatcher_poll.h b/src/libcamera/include/event_dispatcher_poll.h index ac3efde0..1c0066c2 100644 --- a/src/libcamera/include/event_dispatcher_poll.h +++ b/src/libcamera/include/event_dispatcher_poll.h @@ -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(); }; |