1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

Kernel: Implement the alarm() syscall.

This commit is contained in:
Andreas Kling 2019-06-07 11:30:07 +02:00
parent a2a6bb93bc
commit d194ce828d
3 changed files with 19 additions and 4 deletions

View file

@ -351,6 +351,8 @@ private:
OwnPtr<ELFLoader> m_elf_loader;
Lock m_big_lock { "Process" };
qword m_alarm_deadline { 0 };
};
class ProcessInspectionHandle {
@ -396,7 +398,7 @@ inline void Process::for_each(Callback callback)
ASSERT_INTERRUPTS_DISABLED();
for (auto* process = g_processes->head(); process;) {
auto* next_process = process->next();
if (!callback(*process))
if (callback(*process) == IterationDecision::Abort)
break;
process = next_process;
}