hotplug: Wakeup libusb_handle_events on libusb_hotplug_deregister_callback

This serves 2 purposes:

1) We use lazy free-ing of the callback structure, for it to be actually
free-ed usbi_hotplug_match() needs to be called. This ensures this actually
happens (rather then waiting for a hotplug event to arrive, and not freeing
the callback as long as no such event arrives).

2) It causes libusb_handle_events to return to its caller on a call to
libusb_hotplug_deregister_callback, which is very useful for apps which use
a thread to do their apps (hotplug) event handling, otherwise that thread will
hang when the app tries to stop until some event happens.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2 files changed