mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +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:
parent
91c72faa3c
commit
c040e64b7d
Notes:
sideshowbarker
2024-07-18 21:47:41 +09:00
Author: https://github.com/BenWiederhake
Commit: c040e64b7d
Pull-request: https://github.com/SerenityOS/serenity/pull/5323
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bgianfo
8 changed files with 39 additions and 38 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue