aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc/rx_stream_terminator.hpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-07-21 16:12:28 -0700
committerMartin Braun <martin.braun@ettus.com>2017-10-04 14:49:57 -0700
commitac6d27348d4e01035183423a031445808c0f6b90 (patch)
tree8e3031b1175437c38b44b4a391a31c8b878db027 /host/lib/rfnoc/rx_stream_terminator.hpp
parent1bd3db57cab62517ecf282c670f2ccd35d1d303d (diff)
downloaduhd-ac6d27348d4e01035183423a031445808c0f6b90.tar.gz
uhd-ac6d27348d4e01035183423a031445808c0f6b90.tar.bz2
uhd-ac6d27348d4e01035183423a031445808c0f6b90.zip
rfnoc: Fix potential double-overrun handling in rx stream terminator
It's feasible that error messages are sent out during overrun handling, which would cause a nested invocation of handle_overrun(). This adds a lock to prevent that.
Diffstat (limited to 'host/lib/rfnoc/rx_stream_terminator.hpp')
-rw-r--r--host/lib/rfnoc/rx_stream_terminator.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/host/lib/rfnoc/rx_stream_terminator.hpp b/host/lib/rfnoc/rx_stream_terminator.hpp
index 5159cd34a..fb205d00c 100644
--- a/host/lib/rfnoc/rx_stream_terminator.hpp
+++ b/host/lib/rfnoc/rx_stream_terminator.hpp
@@ -24,6 +24,7 @@
#include <uhd/rfnoc/scalar_node_ctrl.hpp>
#include <uhd/rfnoc/terminator_node_ctrl.hpp>
#include <uhd/rfnoc/block_ctrl_base.hpp> // For the block macros
+#include <mutex>
namespace uhd {
namespace rfnoc {
@@ -78,6 +79,8 @@ private:
double _samp_rate;
double _tick_rate;
+ std::mutex _overrun_handler_mutex;
+
}; /* class rx_stream_terminator */
}} /* namespace uhd::rfnoc */