diff --git a/webrtc/test/channel_transport/udp_socket2_win.cc b/webrtc/test/channel_transport/udp_socket2_win.cc index 03a823e6a..fe26273e0 100644 --- a/webrtc/test/channel_transport/udp_socket2_win.cc +++ b/webrtc/test/channel_transport/udp_socket2_win.cc @@ -14,6 +14,7 @@ #include #include +#include "webrtc/system_wrappers/interface/sleep.h" #include "webrtc/test/channel_transport/traffic_control_win.h" #include "webrtc/test/channel_transport/udp_socket2_manager_win.h" @@ -629,7 +630,7 @@ WebRtc_Word32 UdpSocket2Windows::PostRecv(PerIoContext* pIoContext) tries); // Tell the OS that this is a good place to context switch if // it wants to. - Sleep(0); + SleepMs(0); } } if((rxError == ERROR_IO_PENDING) || (nRet == 0)) diff --git a/webrtc/test/channel_transport/udp_socket_manager_posix.cc b/webrtc/test/channel_transport/udp_socket_manager_posix.cc index 874164164..8cd270f42 100644 --- a/webrtc/test/channel_transport/udp_socket_manager_posix.cc +++ b/webrtc/test/channel_transport/udp_socket_manager_posix.cc @@ -17,6 +17,7 @@ #include #include +#include "webrtc/system_wrappers/interface/sleep.h" #include "webrtc/system_wrappers/interface/trace.h" #include "webrtc/test/channel_transport/udp_socket_posix.h" @@ -286,19 +287,13 @@ bool UdpSocketManagerPosixImpl::Process() if (num == SOCKET_ERROR) { // Timeout = 10 ms. - timespec t; - t.tv_sec = 0; - t.tv_nsec = 10000*1000; - nanosleep(&t, NULL); + SleepMs(10); return true; } }else { // Timeout = 10 ms. - timespec t; - t.tv_sec = 0; - t.tv_nsec = 10000*1000; - nanosleep(&t, NULL); + SleepMs(10); return true; }