From 912ed28b3df13b9f9c33f2fa92867ec0ac7445fd Mon Sep 17 00:00:00 2001 From: Ciro Nishiguchi Date: Wed, 2 Oct 2019 21:49:53 -0500 Subject: rfnoc: Make trasnport safe to use with offload threads Make transports safe to use with an offload thread by ensuring that the callbacks and the API methods can execute concurrently. Also, ensure that the transports release their I/O service clients prior to allowing their other member variables be destroyed. --- host/lib/rfnoc/chdr_tx_data_xport.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'host/lib/rfnoc/chdr_tx_data_xport.cpp') diff --git a/host/lib/rfnoc/chdr_tx_data_xport.cpp b/host/lib/rfnoc/chdr_tx_data_xport.cpp index cb28c7ac9..550dde59a 100644 --- a/host/lib/rfnoc/chdr_tx_data_xport.cpp +++ b/host/lib/rfnoc/chdr_tx_data_xport.cpp @@ -69,6 +69,12 @@ chdr_tx_data_xport::chdr_tx_data_xport(uhd::transport::io_service::sptr io_srv, recv_cb); } +chdr_tx_data_xport::~chdr_tx_data_xport() +{ + // Release send_io before allowing members needed by callbacks be destroyed + _send_io.reset(); +} + /* * To configure flow control, we need to send an init strc packet, then * receive a strs containing the stream endpoint ingress buffer size. We -- cgit v1.2.3