Reference:
http://libusb.6.n5.nabble.com/Shutting-Down-Handlers-Cleanly-td5662459.html

This may be worth some discussions in the libusbx since
libusbx will be where the main Windows development
happen.

On Tue, Apr 24, 2012 at 11:44 PM, Garret Kelly <g...@chromium.org> wrote:
> Hello libusb-devel,
> Recently I've been adding USB support into a large application with a
> fairly inflexible threading model. Since it has to run on Windows as
> well, I can't simply use libusb_get_pollfds and add them to a watch
> set, so I've spun up a new thread that calls handle_events_completed
> in a loop. When it comes time to terminate the application, what's the
> correct way to interrupt the blocking handle_events_completed call?
> Calling libusb_exit on the associated context from another thread
> doesn't work, because the event handler will attempt to use the
> context object after its poll call is finished by the closing of the
> control descriptor.




-- 
Xiaofan

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to