Closed hughsie closed 2 years ago
but there must have been some reason in the past to do use the threaded approach
FreeBSD and Windows
I mean, any hotplug event coming from libusb is first pushed into an idle handler.
Right, but it's re-entrant because of the thread. That means the lock gets taken twice by each thread.
Uh, that sounds "fun". I don't really have an opinion on using a custom GSource vs. threading. In a way, GSource seems nicer to me personally, but there must have been some reason in the past to do use the threaded approach.
I am not quite sure why it could recurse through the hotplug code. I mean, any hotplug event coming from libusb is first pushed into an idle handler. Maybe the recursion is happening through some other place? Or it is some corner case that happens during enumeration?