aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-04-26 09:30:48 -0700
committerMartin Braun <martin.braun@ettus.com>2018-04-30 17:10:26 -0700
commit0303f1ed558b21e40f80c388b096432b4bf6e883 (patch)
tree05afcc4d2401bb86f9e38e3b04ec5b07e9268302 /host/utils
parentfc67052345373c6d5c1b62064a9f9ef6f888e3ff (diff)
downloaduhd-0303f1ed558b21e40f80c388b096432b4bf6e883.tar.gz
uhd-0303f1ed558b21e40f80c388b096432b4bf6e883.tar.bz2
uhd-0303f1ed558b21e40f80c388b096432b4bf6e883.zip
lib: Purge all references to boost::this_thread::sleep()
Replace with std::this_thread::sleep_for().
Diffstat (limited to 'host/utils')
-rw-r--r--host/utils/b2xx_fx3_utils.cpp5
-rw-r--r--host/utils/query_gpsdo_sensors.cpp6
-rw-r--r--host/utils/uhd_cal_rx_iq_balance.cpp6
-rw-r--r--host/utils/uhd_cal_tx_dc_offset.cpp6
-rw-r--r--host/utils/uhd_cal_tx_iq_balance.cpp6
5 files changed, 18 insertions, 11 deletions
diff --git a/host/utils/b2xx_fx3_utils.cpp b/host/utils/b2xx_fx3_utils.cpp
index f261cc61c..75bb1a5bb 100644
--- a/host/utils/b2xx_fx3_utils.cpp
+++ b/host/utils/b2xx_fx3_utils.cpp
@@ -15,13 +15,14 @@
#include <string>
#include <cmath>
#include <cstring>
+#include <chrono>
+#include <thread>
#include <stdint.h>
#include <boost/filesystem.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/format.hpp>
#include <boost/program_options.hpp>
-#include <boost/thread/thread.hpp>
#include <boost/functional/hash.hpp>
#include <b200_iface.hpp>
@@ -395,7 +396,7 @@ int32_t main(int32_t argc, char *argv[]) {
// re-open device
b200.reset();
handle.reset();
- boost::this_thread::sleep(boost::posix_time::seconds(2)); // wait 2 seconds for FX3 to reset
+ std::this_thread::sleep_for(std::chrono::seconds(2)); // wait 2 seconds for FX3 to reset
handle = open_device(vid, pid);
if (!handle)
return -1;
diff --git a/host/utils/query_gpsdo_sensors.cpp b/host/utils/query_gpsdo_sensors.cpp
index 525c20482..d909f83a9 100644
--- a/host/utils/query_gpsdo_sensors.cpp
+++ b/host/utils/query_gpsdo_sensors.cpp
@@ -15,13 +15,13 @@
#include <boost/format.hpp>
#include <iostream>
#include <complex>
-#include <boost/thread.hpp>
#include <string>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <chrono>
#include <thread>
+
namespace po = boost::program_options;
namespace fs = boost::filesystem;
@@ -130,7 +130,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
if(std::find(sensor_names.begin(), sensor_names.end(), "ref_locked") != sensor_names.end()) {
uhd::sensor_value_t ref_locked = usrp->get_mboard_sensor("ref_locked",0);
for (size_t i = 0; not ref_locked.to_bool() and i < 100; i++) {
- boost::this_thread::sleep(boost::posix_time::milliseconds(100));
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
ref_locked = usrp->get_mboard_sensor("ref_locked",0);
}
if(not ref_locked.to_bool()) {
@@ -210,7 +210,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//second and set the device time at the next PPS edge
usrp->set_time_next_pps(uhd::time_spec_t(gps_time.to_int() + 1.0));
//allow some time to make sure the PPS has come…
- boost::this_thread::sleep(boost::posix_time::milliseconds(1100));
+ std::this_thread::sleep_for(std::chrono::milliseconds(1100));
//…then ask
gps_seconds = usrp->get_mboard_sensor("gps_time").to_int();
pps_seconds = usrp->get_time_last_pps().to_ticks(1.0);
diff --git a/host/utils/uhd_cal_rx_iq_balance.cpp b/host/utils/uhd_cal_rx_iq_balance.cpp
index 254ea9de7..470a66f9c 100644
--- a/host/utils/uhd_cal_rx_iq_balance.cpp
+++ b/host/utils/uhd_cal_rx_iq_balance.cpp
@@ -20,6 +20,8 @@
#include <cmath>
#include <ctime>
#include <cstdlib>
+#include <chrono>
+#include <thread>
namespace po = boost::program_options;
@@ -73,7 +75,7 @@ static double tune_rx_and_tx(uhd::usrp::multi_usrp::sptr usrp, const double rx_l
usrp->set_tx_freq(tx_tune_req);
//wait for the LOs to become locked
- boost::this_thread::sleep(boost::posix_time::milliseconds(50));
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
boost::system_time start = boost::get_system_time();
while (not usrp->get_tx_sensor("lo_locked").to_bool() or not usrp->get_rx_sensor("lo_locked").to_bool())
{
@@ -278,7 +280,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[])
//stop the transmitter
threads.interrupt_all();
- boost::this_thread::sleep(boost::posix_time::milliseconds(500)); //wait for threads to finish
+ std::this_thread::sleep_for(std::chrono::milliseconds(500)); //wait for threads to finish
threads.join_all();
store_results(results, "RX", "rx", "iq", serial);
diff --git a/host/utils/uhd_cal_tx_dc_offset.cpp b/host/utils/uhd_cal_tx_dc_offset.cpp
index 4adea9c2a..ecd676e07 100644
--- a/host/utils/uhd_cal_tx_dc_offset.cpp
+++ b/host/utils/uhd_cal_tx_dc_offset.cpp
@@ -18,6 +18,8 @@
#include <iostream>
#include <complex>
#include <ctime>
+#include <chrono>
+#include <thread>
namespace po = boost::program_options;
@@ -80,7 +82,7 @@ static double tune_rx_and_tx(uhd::usrp::multi_usrp::sptr usrp, const double tx_l
usrp->set_rx_freq(rx_tune_req);
//wait for the LOs to become locked
- boost::this_thread::sleep(boost::posix_time::milliseconds(50));
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
boost::system_time start = boost::get_system_time();
while (not usrp->get_tx_sensor("lo_locked").to_bool() or not usrp->get_rx_sensor("lo_locked").to_bool())
{
@@ -282,7 +284,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[])
//stop the transmitter
threads.interrupt_all();
- boost::this_thread::sleep(boost::posix_time::milliseconds(500)); //wait for threads to finish
+ std::this_thread::sleep_for(std::chrono::milliseconds(500)); //wait for threads to finish
threads.join_all();
store_results(results, "TX", "tx", "dc", serial);
diff --git a/host/utils/uhd_cal_tx_iq_balance.cpp b/host/utils/uhd_cal_tx_iq_balance.cpp
index 3cc7b80c7..da8807479 100644
--- a/host/utils/uhd_cal_tx_iq_balance.cpp
+++ b/host/utils/uhd_cal_tx_iq_balance.cpp
@@ -15,6 +15,8 @@
#include <complex>
#include <ctime>
#include <cstdlib>
+#include <chrono>
+#include <thread>
namespace po = boost::program_options;
@@ -77,7 +79,7 @@ static double tune_rx_and_tx(uhd::usrp::multi_usrp::sptr usrp, const double tx_l
usrp->set_rx_freq(rx_tune_req);
//wait for the LOs to become locked
- boost::this_thread::sleep(boost::posix_time::milliseconds(50));
+ std::this_thread::sleep_for(std::chrono::milliseconds(50));
boost::system_time start = boost::get_system_time();
while (not usrp->get_tx_sensor("lo_locked").to_bool() or not usrp->get_rx_sensor("lo_locked").to_bool())
{
@@ -281,7 +283,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[])
//stop the transmitter
threads.interrupt_all();
- boost::this_thread::sleep(boost::posix_time::milliseconds(500)); //wait for threads to finish
+ std::this_thread::sleep_for(std::chrono::milliseconds(500)); //wait for threads to finish
threads.join_all();
store_results(results, "TX", "tx", "iq", serial);