Skip to content
Commit bf11c134 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman
Browse files

staging: comedi: use attach_lock semaphore during attach and detach



Acquire the `attach_lock` semaphore in the `struct comedi_device` while
modifying the `attached` flag.  This is a "write" acquire.  Note that
the main mutex in the `struct comedi_device` is also held at this time.
Tasks wishing to check the device is attached will need to either
acquire the main mutex, or "read" acquire the `attach_lock` semaphore,
or both in that order.

Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2f3fdcd7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment