Re: [Libusbx-devel] Improving linux hotplug disconnect

2013-08-21 Thread Hans de Goede
Hi, On 06/27/2013 06:22 PM, Chris Dickens wrote: > Hi, > > > On Thu, Jun 27, 2013 at 3:31 AM, Hans de Goede > wrote: > > Hi, > > +/* device will still be marked as attached if hotplug monitor thread > +* hasn't processed remove event yet */ >

Re: [Libusbx-devel] Improving linux hotplug disconnect

2013-06-27 Thread Hans de Goede
Hi, On 06/27/2013 06:22 PM, Chris Dickens wrote: > Hi, > > > On Thu, Jun 27, 2013 at 3:31 AM, Hans de Goede > wrote: > > Hi, > > +/* device will still be marked as attached if hotplug monitor thread > +* hasn't processed remove event yet */ >

Re: [Libusbx-devel] Improving linux hotplug disconnect

2013-06-27 Thread Chris Dickens
Hi, On Thu, Jun 27, 2013 at 3:31 AM, Hans de Goede wrote: > Hi, > > +/* device will still be marked as attached if hotplug monitor thread >> +* hasn't processed remove event yet */ >> +if (handle->dev->attached) { >> > > This check is racy, you need to take the hotplug lock before making this

Re: [Libusbx-devel] Improving linux hotplug disconnect

2013-06-27 Thread Hans de Goede
Hi, On 06/26/2013 06:57 PM, Chris Dickens wrote: > Hi, > > On Wed, Jun 26, 2013 at 8:34 AM, Hans de Goede > wrote: > > Hi, > > Hmm, the libusb_poll call in get_device_list() should make this quite > hard to trigger, this will only > happen if udev has not

Re: [Libusbx-devel] Improving linux hotplug disconnect

2013-06-26 Thread Chris Dickens
Hi, On Wed, Jun 26, 2013 at 8:34 AM, Hans de Goede wrote: > Hi, > > Hmm, the libusb_poll call in get_device_list() should make this quite hard > to trigger, this will only > happen if udev has not yet read the kernel event, and send an event on its > own socket. Which likely > means that your se

Re: [Libusbx-devel] Improving linux hotplug disconnect

2013-06-26 Thread Hans de Goede
Hi, On 06/26/2013 09:10 AM, Chris Dickens wrote: > Hi, > > I have noticed some behavior that I believe most users will find undesirable. > The situation is this: > > 1) The application opens a libusb device, which adds this to the poll fds > 2) While the device is opened and IO is occurring, the

[Libusbx-devel] Improving linux hotplug disconnect

2013-06-26 Thread Chris Dickens
Hi, I have noticed some behavior that I believe most users will find undesirable. The situation is this: 1) The application opens a libusb device, which adds this to the poll fds 2) While the device is opened and IO is occurring, the device reboots or otherwise disappears from USB 3) When the dev