2
0
forked from Ivasoft/DSView

Merge pull request #96 from vatrat/pr

Add (temporary?) libusb freeze fix from DSView issue #87
This commit is contained in:
DreamSourceLab
2017-05-19 22:25:30 +08:00
committed by GitHub

View File

@@ -2380,11 +2380,11 @@ static int receive_data(int fd, int revents, const struct sr_dev_inst *sdi)
usb = sdi->conn;
tv.tv_sec = tv.tv_usec = 0;
libusb_handle_events_timeout_completed(drvc->sr_ctx->libusb_ctx, &tv, &completed);
/* broken libusb_handle_events_timeout_completed(drvc->sr_ctx->libusb_ctx, &tv, &completed); */
if (devc->status == DSL_FINISH) {
if (libusb_try_lock_events(drvc->sr_ctx->libusb_ctx) == 0) {
if (libusb_event_handling_ok(drvc->sr_ctx->libusb_ctx)) {
/* broken if (libusb_try_lock_events(drvc->sr_ctx->libusb_ctx) == 0) { */
/* broken if (libusb_event_handling_ok(drvc->sr_ctx->libusb_ctx)) { */
/* Stop GPIF acquisition */
usb = ((struct sr_dev_inst *)devc->cb_data)->conn;
if ((ret = command_stop_acquisition (usb->devhdl)) != SR_OK)
@@ -2393,9 +2393,9 @@ static int receive_data(int fd, int revents, const struct sr_dev_inst *sdi)
sr_info("%s: Sent acquisition stop command!", __func__);
remove_sources(devc);
}
libusb_unlock_events(drvc->sr_ctx->libusb_ctx);
}
/* } */
/* broken libusb_unlock_events(drvc->sr_ctx->libusb_ctx); */
/* } */
}
return TRUE;