aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-03-22 23:21:44 -0700
committerMartin Braun <martin.braun@ettus.com>2017-04-12 12:20:43 -0700
commit068de67366777322a7a132c4739bee9889c2bf19 (patch)
tree913b954192feebefc8540d1f781de06779638fc0 /host/lib
parentba04a5f652e6eec19865a67f163a5dc1f7294e45 (diff)
downloaduhd-068de67366777322a7a132c4739bee9889c2bf19.tar.gz
uhd-068de67366777322a7a132c4739bee9889c2bf19.tar.bz2
uhd-068de67366777322a7a132c4739bee9889c2bf19.zip
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.
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/common/recv_packet_demuxer_3000.hpp33
1 files changed, 3 insertions, 30 deletions
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 <uhd/config.hpp>
#include <uhd/transport/zero_copy.hpp>
-#include <stdint.h>
-#include <boost/thread.hpp>
#include <uhd/utils/log.hpp>
-#include <uhd/utils/atomic.hpp>
#include <uhd/types/time_spec.hpp>
#include <uhd/utils/byteswap.hpp>
+#include <boost/thread.hpp>
+#include <boost/enable_shared_from_this.hpp>
#include <queue>
#include <map>
-#include <boost/enable_shared_from_this.hpp>
+#include <stdint.h>
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<transport::managed_recv_buffer::sptr> queue_type_t;
std::map<uint32_t, queue_type_t> _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;
};