diff options
author | Josh Blum <josh@joshknows.com> | 2013-07-19 14:00:32 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2013-07-19 14:00:32 -0700 |
commit | bb73a21495e15b6221472cb1838b609a91f9c59c (patch) | |
tree | e80469363084a6262ff6403edd23ee0b48ff0aba /host/lib/usrp/common/recv_packet_demuxer_3000.hpp | |
parent | 7c9a4a5a41bb981dd4db66e7b479e4e66d488fa5 (diff) | |
download | uhd-bb73a21495e15b6221472cb1838b609a91f9c59c.tar.gz uhd-bb73a21495e15b6221472cb1838b609a91f9c59c.tar.bz2 uhd-bb73a21495e15b6221472cb1838b609a91f9c59c.zip |
uhd: squashed support modules for usrp3 fpga cores
Diffstat (limited to 'host/lib/usrp/common/recv_packet_demuxer_3000.hpp')
-rw-r--r-- | host/lib/usrp/common/recv_packet_demuxer_3000.hpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/host/lib/usrp/common/recv_packet_demuxer_3000.hpp b/host/lib/usrp/common/recv_packet_demuxer_3000.hpp index 9de3666dd..4fb6c4604 100644 --- a/host/lib/usrp/common/recv_packet_demuxer_3000.hpp +++ b/host/lib/usrp/common/recv_packet_demuxer_3000.hpp @@ -92,7 +92,10 @@ namespace uhd{ namespace usrp{ if (new_sid != sid) { boost::mutex::scoped_lock l(mutex); - _queues[new_sid].push(buff); + if (_queues.count(new_sid) == 0) UHD_MSG(error) + << "recv packet demuxer unexpected sid 0x" << std::hex << new_sid << std::dec + << std::endl; + else _queues[new_sid].push(buff); buff.reset(); } } @@ -102,6 +105,15 @@ namespace uhd{ namespace usrp{ return buff; } + void realloc_sid(const boost::uint32_t sid) + { + boost::mutex::scoped_lock l(mutex); + while(not _queues[sid].empty()) //allocated and clears if already allocated + { + _queues[sid].pop(); + } + } + typedef std::queue<transport::managed_recv_buffer::sptr> queue_type_t; std::map<boost::uint32_t, queue_type_t> _queues; transport::zero_copy_if::sptr _xport; |