diff options
author | michael-west <michael.west@ettus.com> | 2020-07-07 13:37:25 -0700 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-08-04 15:41:07 -0500 |
commit | d7c64eb4b13670dbc5728f994e70dca60616af63 (patch) | |
tree | 706844126fe06450e8f262ef1b48dedbe14680de /host/lib/include/uhdlib/transport/io_service.hpp | |
parent | 6d4c07d09ad54155df7ed374e7fbfebd9d40758b (diff) | |
download | uhd-d7c64eb4b13670dbc5728f994e70dca60616af63.tar.gz uhd-d7c64eb4b13670dbc5728f994e70dca60616af63.tar.bz2 uhd-d7c64eb4b13670dbc5728f994e70dca60616af63.zip |
RFNoC: Add xport disconnect callbacks
Transports were not disconnecting their links from the I/O service upon
destruction, leaving behind inaccessible send and recv links used by
nothing. This led to I/O errors after creating several transports.
Added callbacks to transports to automatically disconnect their links
from the I/O service when the transport is destroyed. Updated all
callers to supply a disconnect callback.
Signed-off-by: michael-west <michael.west@ettus.com>
Diffstat (limited to 'host/lib/include/uhdlib/transport/io_service.hpp')
-rw-r--r-- | host/lib/include/uhdlib/transport/io_service.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/host/lib/include/uhdlib/transport/io_service.hpp b/host/lib/include/uhdlib/transport/io_service.hpp index 62dfdfe0d..0cc2f86e3 100644 --- a/host/lib/include/uhdlib/transport/io_service.hpp +++ b/host/lib/include/uhdlib/transport/io_service.hpp @@ -78,6 +78,13 @@ using recv_callback_t = std::function<bool(frame_buff::uptr&, recv_link_if*, send_link_if*)>; /*! + * Callback to disconnect links. This allows a function to be registered + * that can call back to the io_service_mgr to completely disconnect the + * links. + */ +using disconnect_callback_t = std::function<void()>; + +/*! * Interface for a recv transport to request/release buffers from a link. A * recv transport is a transport with a primary purpose of receiving data, and * the recv_io_if class interacts with the io_service to schedule the data |