diff options
author | Ryan Volz <ryan.volz@gmail.com> | 2020-10-01 16:05:00 -0400 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2020-10-20 06:44:27 -0400 |
commit | 8b9aad0e554cd48bd3cbbd5ef341f735bea50312 (patch) | |
tree | 1d90ed4077871053568eec8406d6212e97fd817c /gr-network | |
parent | docs: Exclude gr-newmod from Doxygen (diff) | |
download | gnuradio-8b9aad0e554cd48bd3cbbd5ef341f735bea50312.tar.xz gnuradio-8b9aad0e554cd48bd3cbbd5ef341f735bea50312.zip |
network: lib: Use std functions for sleep instead of usleep.
This fixes compilation with MSVC.
Diffstat (limited to 'gr-network')
-rw-r--r-- | gr-network/lib/tcp_sink_impl.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gr-network/lib/tcp_sink_impl.cc b/gr-network/lib/tcp_sink_impl.cc index 0c596d1d3..8d164697a 100644 --- a/gr-network/lib/tcp_sink_impl.cc +++ b/gr-network/lib/tcp_sink_impl.cc @@ -15,7 +15,9 @@ #include "tcp_sink_impl.h" #include <gnuradio/io_signature.h> +#include <chrono> #include <sstream> +#include <thread> namespace gr { namespace network { @@ -112,7 +114,7 @@ void tcp_sink_impl::run_listener() connect(d_initial_connection); d_initial_connection = false; } else - usleep(10); + std::this_thread::sleep_for(std::chrono::microseconds(10)); } d_thread_running = false; @@ -208,7 +210,7 @@ bool tcp_sink_impl::stop() if (d_listener_thread) { while (d_thread_running) - usleep(5); + std::this_thread::sleep_for(std::chrono::microseconds(5)); delete d_listener_thread; d_listener_thread = NULL; |