aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authorPaul David <paul.david@ettus.com>2017-01-03 17:35:32 -0500
committerMartin Braun <martin.braun@ettus.com>2017-01-19 18:26:35 -0800
commit157b17049f2ffe407183900954f56b103eb710fb (patch)
tree2b630013bfea01484afe184b7c17c8623d3db996 /host/lib/usrp
parent4661358a0bc90f215ee0e18d2515d5cb974561c8 (diff)
downloaduhd-157b17049f2ffe407183900954f56b103eb710fb.tar.gz
uhd-157b17049f2ffe407183900954f56b103eb710fb.tar.bz2
uhd-157b17049f2ffe407183900954f56b103eb710fb.zip
x300: Run motherboard setup with multiple threads
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index 83c687637..313e070b3 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -381,7 +381,7 @@ static void x300_load_fw(wb_iface::sptr fw_reg_ctrl, const std::string &file_nam
UHD_MSG(status) << " done!" << std::endl;
}
-x300_impl::x300_impl(const uhd::device_addr_t &dev_addr)
+x300_impl::x300_impl(const uhd::device_addr_t &dev_addr)
: device3_impl()
, _sid_framer(0)
{
@@ -391,10 +391,23 @@ x300_impl::x300_impl(const uhd::device_addr_t &dev_addr)
const device_addrs_t device_args = separate_device_addr(dev_addr);
_mb.resize(device_args.size());
+
+ if (dev_addr.has_key("serialize_init") or device_args.size() == 1) {
+ for (size_t i = 0; i < device_args.size(); i++)
+ {
+ this->setup_mb(i, device_args[i]);
+ }
+ return;
+ }
+
+ boost::thread_group setup_threads;
for (size_t i = 0; i < device_args.size(); i++)
{
- this->setup_mb(i, device_args[i]);
+ setup_threads.create_thread(
+ boost::bind(&x300_impl::setup_mb, this, i, device_args[i])
+ );
}
+ setup_threads.join_all();
}
void x300_impl::mboard_members_t::discover_eth(