From 068de67366777322a7a132c4739bee9889c2bf19 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 22 Mar 2017 23:21:44 -0700 Subject: uhd: Removed unused code in recv_packet_demuxer_proxy_3000 All this code required defining RECV_PACKET_DEMUXER_3000_THREAD_SAFE, which we never set. --- host/lib/usrp/common/recv_packet_demuxer_3000.hpp | 33 +++-------------------- 1 file changed, 3 insertions(+), 30 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/common/recv_packet_demuxer_3000.hpp b/host/lib/usrp/common/recv_packet_demuxer_3000.hpp index 2fe534c03..5305c8ddd 100644 --- a/host/lib/usrp/common/recv_packet_demuxer_3000.hpp +++ b/host/lib/usrp/common/recv_packet_demuxer_3000.hpp @@ -20,15 +20,14 @@ #include #include -#include -#include #include -#include #include #include +#include +#include #include #include -#include +#include namespace uhd{ namespace usrp{ @@ -77,24 +76,6 @@ namespace uhd{ namespace usrp{ return buff; } } - // Following is disabled by default as super_recv_packet_handler (caller) is not thread safe - // Only underlying transport (libusb1_zero_copy) is thread safe - // The onus is on the caller to super_recv_packet_handler (and therefore this) to serialise access -#ifdef RECV_PACKET_DEMUXER_3000_THREAD_SAFE - //---------------------------------------------------------- - //-- Try to claim the transport or wait patiently - //---------------------------------------------------------- - if (_claimed.exchange(true)) - { - boost::mutex::scoped_lock l(mutex); - cond.timed_wait(l, boost::posix_time::microseconds(long(timeout*1e6))); - } - - //---------------------------------------------------------- - //-- Wait on the transport for input buffers - //---------------------------------------------------------- - else -#endif // RECV_PACKET_DEMUXER_3000_THREAD_SAFE { buff = _xport->get_recv_buff(timeout); if (buff) @@ -110,10 +91,6 @@ namespace uhd{ namespace usrp{ buff.reset(); } } -#ifdef RECV_PACKET_DEMUXER_3000_THREAD_SAFE - _claimed = false; - cond.notify_all(); -#endif // RECV_PACKET_DEMUXER_3000_THREAD_SAFE } return buff; } @@ -132,10 +109,6 @@ namespace uhd{ namespace usrp{ typedef std::queue queue_type_t; std::map _queues; transport::zero_copy_if::sptr _xport; -#ifdef RECV_PACKET_DEMUXER_3000_THREAD_SAFE - std::atomic_bool _claimed; - boost::condition_variable cond; -#endif // RECV_PACKET_DEMUXER_3000_THREAD_SAFE boost::mutex mutex; }; -- cgit v1.2.3