py: Switch to non-blocking eventfd

Blocking wait can be easily implemented on top in Python, so rather than
supporting only blocking reads, or supporting both non-blocking and
blocking reads, let's support only non-blocking reads.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Tomi Valkeinen 2022-08-19 14:16:15 +03:00 committed by Laurent Pinchart
parent de7f1aa591
commit bf3dbaece9
6 changed files with 41 additions and 12 deletions

View file

@ -88,8 +88,9 @@ class CaptureContext:
camera_contexts: list[CameraCaptureContext] = []
def handle_camera_event(self):
# cm.get_ready_requests() will not block here, as we know there is an event
# to read.
# cm.get_ready_requests() returns the ready requests, which in our case
# should almost always return a single Request, but in some cases there
# could be multiple or none.
reqs = self.cm.get_ready_requests()