mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
lib: Add internal fpi_timeout_cancel_all_for_dev()
This will be used to disable all timeouts for a device that's about to be closed, and freed.
This commit is contained in:
@@ -327,7 +327,7 @@ int fpi_img_compare_print_data_to_gallery(struct fp_print_data *print,
|
|||||||
struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int w_factor, unsigned int h_factor);
|
struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int w_factor, unsigned int h_factor);
|
||||||
|
|
||||||
/* polling */
|
/* polling */
|
||||||
|
void fpi_timeout_cancel_all_for_dev(struct fp_dev *dev);
|
||||||
void fpi_poll_init(void);
|
void fpi_poll_init(void);
|
||||||
void fpi_poll_exit(void);
|
void fpi_poll_exit(void);
|
||||||
|
|
||||||
|
|||||||
@@ -477,3 +477,22 @@ void fpi_poll_exit(void)
|
|||||||
libusb_set_pollfd_notifiers(fpi_usb_ctx, NULL, NULL, NULL);
|
libusb_set_pollfd_notifiers(fpi_usb_ctx, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
fpi_timeout_cancel_all_for_dev(struct fp_dev *dev)
|
||||||
|
{
|
||||||
|
GSList *l;
|
||||||
|
|
||||||
|
g_return_if_fail (dev != NULL);
|
||||||
|
|
||||||
|
l = active_timers;
|
||||||
|
while (l) {
|
||||||
|
struct fpi_timeout *timeout = l->data;
|
||||||
|
GSList *current = l;
|
||||||
|
|
||||||
|
l = l->next;
|
||||||
|
if (timeout->dev == dev) {
|
||||||
|
g_free (timeout);
|
||||||
|
active_timers = g_slist_delete_link (active_timers, current);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user