aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorAlex Williams <alex.williams@ni.com>2019-12-20 16:02:55 -0800
committerBrent Stapleton <brent.stapleton@ettus.com>2019-12-20 16:18:40 -0800
commit797d54bc2573688eebcb2c639cb07e4ab6d5ab9d (patch)
tree60137afa570c68bac3790e902bcca0230d9c111c /host/lib
parented273d6353995f356fc8624566628f8219528cd0 (diff)
downloaduhd-797d54bc2573688eebcb2c639cb07e4ab6d5ab9d.tar.gz
uhd-797d54bc2573688eebcb2c639cb07e4ab6d5ab9d.tar.bz2
uhd-797d54bc2573688eebcb2c639cb07e4ab6d5ab9d.zip
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.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/transport/offload_io_service.cpp7
1 files changed, 2 insertions, 5 deletions
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<std::thread> _offload_thread;
std::atomic<bool> _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");
}