From patchwork Wed Jan 23 08:59:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 344 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9084160B1B for ; Wed, 23 Jan 2019 09:59:28 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ECF8423D for ; Wed, 23 Jan 2019 09:59:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1548233968; bh=2/3N+MKlqqcnjxXlFEFN80wN4MXLQT5VBb5XnjVuUZo=; h=From:To:Subject:Date:From; b=YZAfsLaBcatw//YiU/1vEGxagVlHT1tKuEHSkMwQdI5Bv3kbeh1WNrzkhxC3HLZ7B x/lQYmCpT4EjtRXYI77aqiROdwS7pN8a7wNKCPTQdbqzC0pqZNzYg0bin5WDnfuz9w +BGBHqGjdoEJdDfvOauMF2xq1scm13ZOHslECOk0= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Wed, 23 Jan 2019 10:59:19 +0200 Message-Id: <20190123085923.12524-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/4] Event dispatcher enhancements X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 08:59:28 -0000 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 Reviewed-by: Niklas Söderlund