From fcb7c38b15319aa021ba55bc3a06a3269ac3ea6f Mon Sep 17 00:00:00 2001 From: "hta@webrtc.org" Date: Thu, 4 Apr 2013 08:56:34 +0000 Subject: [PATCH] Two more sleep calls converted to use SleepMs(). This is CL 753005 in its new home. BUG=603 Review URL: https://webrtc-codereview.appspot.com/1201008 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3761 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/test/channel_transport/udp_socket2_win.cc | 3 ++- .../channel_transport/udp_socket_manager_posix.cc | 11 +++-------- 2 files changed, 5 insertions(+), 9 deletions(-) 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; }