From 6bd43946a71173cbf0f1d318843ba34d6849dc30 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 7 Jun 2019 21:37:15 -0700 Subject: rfnoc: Add shutdown feature to blocks On destruction, the rfnoc_graph will call shutdown() on all blocks. This allows a safe de-initialization of blocks independent of the lifetime of the noc_block_base::sptr. Also adds the shutdown feature to null_block_control. --- host/lib/include/uhdlib/rfnoc/block_container.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'host/lib/include/uhdlib/rfnoc/block_container.hpp') diff --git a/host/lib/include/uhdlib/rfnoc/block_container.hpp b/host/lib/include/uhdlib/rfnoc/block_container.hpp index e32feed52..b43a7bc61 100644 --- a/host/lib/include/uhdlib/rfnoc/block_container.hpp +++ b/host/lib/include/uhdlib/rfnoc/block_container.hpp @@ -43,6 +43,12 @@ public: */ noc_block_base::sptr get_block(const block_id_t& block_id) const; + /*! Call shutdown() on all blocks + * + * After calling this, blocks won't be able to do anything anymore! + */ + void shutdown(); + private: //! Lock access to the storage mutable std::mutex _mutex; -- cgit v1.2.3