1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 05:05:08 +00:00

Kernel: Move some time related code from Scheduler into TimeManagement

Use the TimerQueue to expire blocking operations, which is one less thing
the Scheduler needs to check on every iteration.

Also, add a BlockTimeout class that will automatically handle relative or
absolute timeouts as well as overriding timeouts (e.g. socket timeouts)
more consistently.

Also, rework the TimerQueue class to be able to fire events from
any processor, which requires Timer to be RefCounted. Also allow
creating id-less timers for use by blocking operations.
This commit is contained in:
Tom 2020-11-15 11:58:19 -07:00 committed by Andreas Kling
parent e0e26c6c67
commit 6cb640eeba
19 changed files with 461 additions and 263 deletions

View file

@ -38,7 +38,7 @@ void SyncTask::spawn()
dbg() << "SyncTask is running";
for (;;) {
VFS::the().sync();
Thread::current()->sleep(1 * TimeManagement::the().ticks_per_second());
Thread::current()->sleep({ 1, 0 });
}
});
}