From 95d88735ee815814dee49c553278a8633afebeae Mon Sep 17 00:00:00 2001 From: "hta@webrtc.org" Date: Tue, 2 Apr 2013 14:46:33 +0000 Subject: [PATCH] Two more sleep calls converted to use SleepMs(). BUG=603 Review URL: https://webrtc-codereview.appspot.com/753005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3751 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../udp_transport/source/udp_socket2_windows.cc | 9 +++++---- .../source/udp_socket_manager_posix.cc | 15 +++++---------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/webrtc/modules/udp_transport/source/udp_socket2_windows.cc b/webrtc/modules/udp_transport/source/udp_socket2_windows.cc index 2362cdd01..d6bc32e1b 100644 --- a/webrtc/modules/udp_transport/source/udp_socket2_windows.cc +++ b/webrtc/modules/udp_transport/source/udp_socket2_windows.cc @@ -8,14 +8,15 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "udp_socket2_windows.h" +#include "modules/udp_transport/source/udp_socket2_windows.h" #include #include #include -#include "traffic_control_windows.h" -#include "udp_socket2_manager_windows.h" +#include "modules/udp_transport/source/traffic_control_windows.h" +#include "modules/udp_transport/source/udp_socket2_manager_windows.h" +#include "system_wrappers/interface/sleep.h" #pragma warning(disable : 4311) @@ -627,7 +628,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/modules/udp_transport/source/udp_socket_manager_posix.cc b/webrtc/modules/udp_transport/source/udp_socket_manager_posix.cc index 889fb2fd4..1705aefcb 100644 --- a/webrtc/modules/udp_transport/source/udp_socket_manager_posix.cc +++ b/webrtc/modules/udp_transport/source/udp_socket_manager_posix.cc @@ -16,8 +16,9 @@ #include #include -#include "trace.h" -#include "udp_socket_posix.h" +#include "modules/udp_transport/source/udp_socket_posix.h" +#include "system_wrappers/interface/sleep.h" +#include "system_wrappers/interface/trace.h" namespace webrtc { UdpSocketManagerPosix::UdpSocketManagerPosix() @@ -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; }