summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gusb/gusb-context.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gusb/gusb-context.c b/gusb/gusb-context.c
index dd7fb0c..868676e 100644
--- a/gusb/gusb-context.c
+++ b/gusb/gusb-context.c
@@ -578,9 +578,13 @@ g_usb_context_event_thread_cb (gpointer data)
{
GUsbContext *context = G_USB_CONTEXT (data);
GUsbContextPrivate *priv = context->priv;
+ struct timeval tv = {
+ .tv_sec = 0,
+ .tv_usec = 1000,
+ };
while (g_atomic_int_get (&priv->thread_event_run) > 0)
- libusb_handle_events (priv->ctx);
+ libusb_handle_events_timeout_completed (priv->ctx, &tv, NULL);
return NULL;
}