X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Flibsigrok-internal.h;h=ea0960c7a6e360291bf9486a1184b97264aec881;hb=aff94d065e3ef50fa022b3e79b0dc435ae2c5b0a;hp=7023c491cb1591fbfdec85dcdc25757fed41f619;hpb=faa5d7d997718acdd2b293a32dd62e28268b391f;p=libsigrok.git diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index 7023c491..ea0960c7 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -206,15 +206,12 @@ struct sr_context { #ifdef HAVE_LIBUSB_1_0 libusb_context *libusb_ctx; gboolean usb_source_present; -#ifdef _WIN32 - GThread *usb_thread; - gboolean usb_thread_running; - HANDLE usb_wait_request_event; - HANDLE usb_wait_complete_event; - GPollFD usb_pollfd; +# ifdef G_OS_WIN32 + int64_t usb_timeout; + int64_t usb_due; sr_receive_data_callback usb_cb; void *usb_cb_data; -#endif +# endif #endif }; @@ -722,10 +719,11 @@ struct sr_session { gboolean running; /* - * Each I/O source has an entry with the same index in both "sources" - * and "pollfds". The "sources" array may be larger than "pollfds", - * in which case the excess sources are pure timer sources. - * We can not embed the GPollFD into the source struct since we want + * Event sources and poll FDs are stored in the same order in the + * the sources and pollfds arrays. However, each source may cover + * any number of associated poll FDs, so the indices do not match. + * + * We cannot embed the GPollFD into the source struct since we want * to be able to pass the array of all poll descriptors to g_poll(). */ GArray *sources; @@ -743,8 +741,11 @@ struct sr_session { }; SR_PRIV int sr_session_source_add_internal(struct sr_session *session, - GPollFD *pollfd, int timeout, sr_receive_data_callback cb, - void *cb_data, gintptr poll_object, gboolean is_usb); + const GPollFD *pollfds, int num_fds, int timeout, + sr_receive_data_callback cb, void *cb_data, + gintptr poll_object); +SR_PRIV int sr_session_source_remove_internal(struct sr_session *session, + gintptr poll_object); SR_PRIV int sr_session_send(const struct sr_dev_inst *sdi, const struct sr_datafeed_packet *packet); SR_PRIV int sr_session_stop_sync(struct sr_session *session);