Handle signal interruptions during sleep

This commit is contained in:
EnderIce2 2024-03-03 23:58:12 +02:00
parent c2b595452e
commit 914e96b337
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -650,9 +650,13 @@ static int linux_nanosleep(SysFrm *,
while (time < sleepTime)
{
if (pcb->Signals->HasPendingSignal())
{
debug("sleep interrupted by signal");
return -EINTR;
}
pcb->GetContext()->Yield();
/* TODO: sleep should be interrupted by
the signal and return errno EINTR */
time = TimeManager->GetCounter();
}
debug("time= %ld", time);