diff options
Diffstat (limited to 'host/lib/include/uhdlib/utils/atomic.hpp')
-rw-r--r-- | host/lib/include/uhdlib/utils/atomic.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/host/lib/include/uhdlib/utils/atomic.hpp b/host/lib/include/uhdlib/utils/atomic.hpp index 5436eea81..303df1bc9 100644 --- a/host/lib/include/uhdlib/utils/atomic.hpp +++ b/host/lib/include/uhdlib/utils/atomic.hpp @@ -10,9 +10,9 @@ #include <uhd/config.hpp> #include <uhd/types/time_spec.hpp> -#include <uhdlib/utils/system_time.hpp> #include <boost/thread/thread.hpp> #include <atomic> +#include <chrono> namespace uhd{ @@ -31,9 +31,10 @@ namespace uhd{ const double timeout ){ if (cond == value) return true; - const time_spec_t exit_time = uhd::get_system_time() + time_spec_t(timeout); + const auto exit_time = std::chrono::high_resolution_clock::now() + + std::chrono::microseconds(int64_t(timeout * 1e6)); while (cond != value) { - if (uhd::get_system_time() > exit_time) { + if (std::chrono::high_resolution_clock::now() > exit_time) { return false; } boost::this_thread::interruption_point(); |