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
This commit is contained in:
parent
4ff956f428
commit
95d88735ee
@ -8,14 +8,15 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* 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 <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
|
||||||
#include "traffic_control_windows.h"
|
#include "modules/udp_transport/source/traffic_control_windows.h"
|
||||||
#include "udp_socket2_manager_windows.h"
|
#include "modules/udp_transport/source/udp_socket2_manager_windows.h"
|
||||||
|
#include "system_wrappers/interface/sleep.h"
|
||||||
|
|
||||||
#pragma warning(disable : 4311)
|
#pragma warning(disable : 4311)
|
||||||
|
|
||||||
@ -627,7 +628,7 @@ WebRtc_Word32 UdpSocket2Windows::PostRecv(PerIoContext* pIoContext)
|
|||||||
tries);
|
tries);
|
||||||
// Tell the OS that this is a good place to context switch if
|
// Tell the OS that this is a good place to context switch if
|
||||||
// it wants to.
|
// it wants to.
|
||||||
Sleep(0);
|
SleepMs(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if((rxError == ERROR_IO_PENDING) || (nRet == 0))
|
if((rxError == ERROR_IO_PENDING) || (nRet == 0))
|
||||||
|
@ -16,8 +16,9 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "trace.h"
|
#include "modules/udp_transport/source/udp_socket_posix.h"
|
||||||
#include "udp_socket_posix.h"
|
#include "system_wrappers/interface/sleep.h"
|
||||||
|
#include "system_wrappers/interface/trace.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
UdpSocketManagerPosix::UdpSocketManagerPosix()
|
UdpSocketManagerPosix::UdpSocketManagerPosix()
|
||||||
@ -286,19 +287,13 @@ bool UdpSocketManagerPosixImpl::Process()
|
|||||||
if (num == SOCKET_ERROR)
|
if (num == SOCKET_ERROR)
|
||||||
{
|
{
|
||||||
// Timeout = 10 ms.
|
// Timeout = 10 ms.
|
||||||
timespec t;
|
SleepMs(10);
|
||||||
t.tv_sec = 0;
|
|
||||||
t.tv_nsec = 10000*1000;
|
|
||||||
nanosleep(&t, NULL);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
// Timeout = 10 ms.
|
// Timeout = 10 ms.
|
||||||
timespec t;
|
SleepMs(10);
|
||||||
t.tv_sec = 0;
|
|
||||||
t.tv_nsec = 10000*1000;
|
|
||||||
nanosleep(&t, NULL);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user