use nanosleep instead of usleep, ugaX11 calls msSleep instead of usleep
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2376 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -89,6 +89,18 @@ SetTimer (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs))
|
||||
settimer_callback = CallBack;
|
||||
}
|
||||
|
||||
void
|
||||
msSleep (unsigned long Milliseconds)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
ts.tv_sec = Milliseconds / 1000;
|
||||
ts.tv_nsec = (Milliseconds % 1000) * 1000000;
|
||||
|
||||
while (nanosleep (&ts, &ts) != 0 && errno == EINTR)
|
||||
;
|
||||
}
|
||||
|
||||
void
|
||||
GetLocalTime (EFI_TIME *Time)
|
||||
{
|
||||
@@ -110,12 +122,6 @@ GetLocalTime (EFI_TIME *Time)
|
||||
| (tm->tm_isdst > 0 ? EFI_TIME_IN_DAYLIGHT : 0);
|
||||
}
|
||||
|
||||
void
|
||||
msSleep (unsigned long Milliseconds)
|
||||
{
|
||||
usleep (Milliseconds * 1000);
|
||||
}
|
||||
|
||||
static void
|
||||
TzSet (void)
|
||||
{
|
||||
|
Reference in New Issue
Block a user