summaryrefslogtreecommitdiff
path: root/libusb/libusbi.h
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2014-11-17 23:53:06 -0800
committerChris Dickens <chris.dickens@hp.com>2014-12-19 11:11:07 -0800
commit7ede4b76bdfec18850d1c3bbe87af6a0f69f76dc (patch)
tree643979cdbbac3e9ce6deedb1ee77d8d7c382cccc /libusb/libusbi.h
parent7924c1fc67e72e238f24f8fae63d44006de19e85 (diff)
downloadlibusb-7ede4b76bdfec18850d1c3bbe87af6a0f69f76dc.tar.gz
core: Remove taking of events lock inside usbi_fd_notification()
It is unnecessary to take the events lock when a thread needs to interrupt an event handler to receive a change list of poll fds. It is sufficient to simply write to the control pipe and let the event handler be notified of this event when it polls. Taking the events lock inside this function leads to opportunity for deadlock in certain situations, such as a client program running on an OS that uses fd notification on each individual transfer. If the client program were to protect a list of transfers with a single lock, it could deadlock if that lock were taken in two separate threads, one which is attempting to submit a new transfer and one which is executing inside the transfer completion callback. Thanks to Dmitry Fleytman and Pavel Gurvich for reporting this. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Diffstat (limited to 'libusb/libusbi.h')
0 files changed, 0 insertions, 0 deletions