hughsie / libgusb

GUsb is a GObject wrapper for libusb1
GNU Lesser General Public License v2.1
25 stars 21 forks source link

Fix high number of wakeups when checking the GUsbContext #25

Closed hughsie closed 4 years ago

hughsie commented 4 years ago

In 985b9e4ec39ac521e7398a8e3017c96f2c4d75ec I mistakenly thought this was the timeout for the added/removed context checking, which was Windows-specific.

It actually was the main context event thread, which is running all the time. Switch the poll timeout to be 2s, (still down from the default 60s!) which is a better compromise between battery life and context shutdown performance.

Fixes https://github.com/hughsie/libgusb/issues/24

heftig commented 4 years ago

Works for me; thanks.