From 503cd3316c0779498ccf11b4ca8ba7c742d1de17 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Fri, 18 Mar 2022 01:53:00 +0000 Subject: [PATCH] Remove request_exit() function. This just set the do_exit flag, and was now only called in one place. --- host/libhackrf/src/hackrf.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/host/libhackrf/src/hackrf.c b/host/libhackrf/src/hackrf.c index 0868c22b0..e6f015637 100644 --- a/host/libhackrf/src/hackrf.c +++ b/host/libhackrf/src/hackrf.c @@ -181,11 +181,6 @@ static int create_transfer_thread(hackrf_device* device); static libusb_context* g_libusb_context = NULL; int last_libusb_error = LIBUSB_SUCCESS; -static void request_exit(hackrf_device* device) -{ - device->do_exit = true; -} - /* * Check if the transfers are setup and owned by libusb. * @@ -1781,10 +1776,10 @@ static int kill_transfer_thread(hackrf_device* device) * thread has handled all completion callbacks. */ cancel_transfers(device); - /* - * Now call request_exit() to halt the main loop. - */ - request_exit(device); + + // Set flag to tell the thread to exit. + device->do_exit = true; + /* * Interrupt the event handling thread instead of * waiting for timeout.