]> git.karo-electronics.de Git - mv-sheeva.git/commit
V4L/DVB: v4l2: add core serialization lock
authorHans Verkuil <hverkuil@xs4all.nl>
Sun, 26 Sep 2010 11:47:38 +0000 (08:47 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Oct 2010 03:06:14 +0000 (01:06 -0200)
commitee6869afc922a9849979e49bb3bbcad794872fcb
tree2266050d01da694d04b533a6509873888327108b
parentc29fcff3daafbf46d64a543c1950bbd206ad8c1c
V4L/DVB: v4l2: add core serialization lock

Drivers can optionally set a pointer to a mutex in struct video_device.
The core will use that to lock before calling open, read, write, unlocked_ioctl,
poll, mmap or release.

Updated the documentation as well and ensure that v4l2-event knows about the
lock: it will unlock it before doing a blocking wait on an event and relock it
afterwards.

Ensure that the 'video_is_registered' check is done when the lock is held:
a typical disconnect will take the lock as well before unregistering the
device nodes, so to prevent race conditions the video_is_registered check
should also be done with the lock held.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Documentation/video4linux/v4l2-framework.txt
drivers/media/video/v4l2-dev.c
drivers/media/video/v4l2-event.c
include/media/v4l2-dev.h