1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

Kernel: Make TimeManagement use AK::Time internally

I don't dare touch the multi-threading logic and locking mechanism, so it stays
timespec for now. However, this could and should be changed to AK::Time, and I
bet it will simplify the "increment_time_since_boot()" code.
This commit is contained in:
Ben Wiederhake 2021-02-27 23:56:16 +01:00 committed by Andreas Kling
parent 91c72faa3c
commit c040e64b7d
8 changed files with 39 additions and 38 deletions

View file

@ -45,8 +45,7 @@ KResultOr<unsigned> Process::sys$alarm(unsigned seconds)
}
if (seconds > 0) {
// FIXME: Should use AK::Time internally
auto deadline = Time::from_timespec(TimeManagement::the().current_time(CLOCK_REALTIME_COARSE).value());
auto deadline = TimeManagement::the().current_time(CLOCK_REALTIME_COARSE).value();
deadline = deadline + Time::from_seconds(seconds);
m_alarm_timer = TimerQueue::the().add_timer_without_id(CLOCK_REALTIME_COARSE, deadline, [this]() {
[[maybe_unused]] auto rc = send_signal(SIGALRM, nullptr);