Fixed thread sleep time to avoid sleeping 0ms when requested a positive value less then 1000us (Windows only).
git-svn-id: http://yate.null.ro/svn/yate/trunk@2182 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
18a6b5bf79
commit
c7620ef2e6
|
@ -601,7 +601,12 @@ void Thread::msleep(unsigned long msec, bool exitCheck)
|
||||||
void Thread::usleep(unsigned long usec, bool exitCheck)
|
void Thread::usleep(unsigned long usec, bool exitCheck)
|
||||||
{
|
{
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
::Sleep(usec/1000);
|
if (usec) {
|
||||||
|
usec = (usec + 500) / 1000;
|
||||||
|
if (!usec)
|
||||||
|
usec = 1;
|
||||||
|
}
|
||||||
|
::Sleep(usec);
|
||||||
#else
|
#else
|
||||||
::usleep(usec);
|
::usleep(usec);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue