Skip to content

Commit

Permalink
changed, why use nanosleep when usleep will work just as well and it …
Browse files Browse the repository at this point in the history
…will handle any spontanious sleep returns for us
  • Loading branch information
davilla committed Aug 4, 2012
1 parent de39686 commit ee76342
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions xbmc/linux/XTimeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ void WINAPI Sleep(DWORD dwMilliSeconds)
}
#endif

struct timespec req;
req.tv_sec = dwMilliSeconds / 1000;
req.tv_nsec = (dwMilliSeconds % 1000) * 1000000;

// many calls will be interupted. so we keep looping till we're done.
while ( nanosleep(&req, &req) == -1 && errno == EINTR && (req.tv_nsec > 0 || req.tv_sec > 0))
;
usleep(dwMilliSeconds * 1000);
}

VOID GetLocalTime(LPSYSTEMTIME sysTime)
Expand Down

0 comments on commit ee76342

Please sign in to comment.