mirror of
https://github.com/greatscottgadgets/hackrf.git
synced 2026-03-20 14:18:35 +01:00
Indicate success or failure to flush callback.
This commit is contained in:
committed by
Michael Ossmann
parent
4810d1f992
commit
0becbc6b4a
@@ -1770,15 +1770,18 @@ static void* transfer_threadproc(void* arg)
|
||||
|
||||
static void LIBUSB_CALL hackrf_libusb_flush_callback(struct libusb_transfer* usb_transfer)
|
||||
{
|
||||
// TX buffer is now flushed, so proceed with signalling completion.
|
||||
bool success = usb_transfer->status == LIBUSB_TRANSFER_COMPLETED;
|
||||
|
||||
// All transfers have now ended, so proceed with signalling completion.
|
||||
hackrf_device* device = (hackrf_device*) usb_transfer->user_data;
|
||||
pthread_mutex_lock(&device->all_finished_lock);
|
||||
device->flush = false;
|
||||
device->active_transfers = 0;
|
||||
pthread_cond_broadcast(&device->all_finished_cv);
|
||||
pthread_mutex_unlock(&device->all_finished_lock);
|
||||
|
||||
if (device->flush_callback)
|
||||
device->flush_callback(device->flush_ctx);
|
||||
device->flush_callback(device->flush_ctx, success);
|
||||
}
|
||||
|
||||
static void LIBUSB_CALL
|
||||
|
||||
Reference in New Issue
Block a user