From 797d54bc2573688eebcb2c639cb07e4ab6d5ab9d Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Fri, 20 Dec 2019 16:02:55 -0800 Subject: transport: Fix uninitialized offload I/O service _client_type The client type is kept in _offload_thread_params, but a separate, unitialized field is checked in member functions. Remove the duplicate and switch the checks over. This fixes offload_io_srv_test. --- host/lib/transport/offload_io_service.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'host/lib/transport') diff --git a/host/lib/transport/offload_io_service.cpp b/host/lib/transport/offload_io_service.cpp index 8a7895173..ba95c843b 100644 --- a/host/lib/transport/offload_io_service.cpp +++ b/host/lib/transport/offload_io_service.cpp @@ -328,9 +328,6 @@ private: // The I/O service that executes within the offload thread io_service::sptr _io_srv; - // Type of clients supported by this I/O service - client_type_t _client_type; - // Offload thread, its stop flag, and thread-related parameters std::unique_ptr _offload_thread; std::atomic _stop_offload_thread{false}; @@ -469,7 +466,7 @@ recv_io_if::sptr offload_io_service_impl::make_recv_client(recv_link_if::sptr re { UHD_ASSERT_THROW(_offload_thread); - if (_client_type == SEND_ONLY) { + if (_offload_thread_params.client_type == SEND_ONLY) { throw uhd::runtime_error("Recv client not supported by this I/O service"); } @@ -518,7 +515,7 @@ send_io_if::sptr offload_io_service_impl::make_send_client(send_link_if::sptr se { UHD_ASSERT_THROW(_offload_thread); - if (_client_type == RECV_ONLY) { + if (_offload_thread_params.client_type == RECV_ONLY) { throw uhd::runtime_error("Send client not supported by this I/O service"); } -- cgit v1.2.3