[libcamera-devel] [PATCH 0/4] Event dispatcher enhancements

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Jan 23 09:59:19 CET 2019


Hello,

This patch series enhances the event dispatcher with two new features.
In patch 2/4 we get EINTR support to automatically restart the ppoll()
call if it gets interrupted by a signal, and in patch 3/4 the event
dispatcher API is extended with a function to interrupt in-progress
processEvents() calls. This is needed in order to interrupt event loops
gracefully.

The series starts in patch 1/4 by adding a test that fails, to outline
missing EINTR support, which is then fixed by patch 2/4. It ends with
another test case for the new EventDispatcher::interrupt() method.

Laurent Pinchart (4):
  tests: Test event dispatcher interruption by signal
  libcamera: event_dispatcher_poll: Handle interrupted ppoll() calls
  libcamera: event_dispatcher: Add interrupt() function
  tests: event-dispatcher: Add processEvents() interruption test

 include/libcamera/event_dispatcher.h          |   2 +
 src/libcamera/event_dispatcher.cpp            |  10 ++
 src/libcamera/event_dispatcher_poll.cpp       |  82 ++++++++++----
 src/libcamera/include/event_dispatcher_poll.h |   4 +
 test/event-dispatcher.cpp                     | 103 ++++++++++++++++++
 test/meson.build                              |   9 +-
 6 files changed, 184 insertions(+), 26 deletions(-)
 create mode 100644 test/event-dispatcher.cpp

-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list