kvm: Add handling of EAGAIN when creating timers
timer_create can apparently return -1 and set errno to EAGAIN if the kernel suffered a temporary failure when allocating a timer. This happens from time to time, so we need to handle it.
This commit is contained in:
parent
743f80712e
commit
15f81b6ed9
1 changed files with 5 additions and 2 deletions
|
@ -59,8 +59,11 @@ PosixKvmTimer::PosixKvmTimer(int signo, clockid_t clockID,
|
||||||
sev.sigev_notify = SIGEV_SIGNAL;
|
sev.sigev_notify = SIGEV_SIGNAL;
|
||||||
sev.sigev_signo = signo;
|
sev.sigev_signo = signo;
|
||||||
sev.sigev_value.sival_ptr = NULL;
|
sev.sigev_value.sival_ptr = NULL;
|
||||||
if (timer_create(clockID, &sev, &timer) == -1)
|
|
||||||
panic("timer_create");
|
while (timer_create(clockID, &sev, &timer) == -1) {
|
||||||
|
if (errno != EAGAIN)
|
||||||
|
panic("timer_create: %i", errno);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PosixKvmTimer::~PosixKvmTimer()
|
PosixKvmTimer::~PosixKvmTimer()
|
||||||
|
|
Loading…
Reference in a new issue