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

Kernel: Make Thread use AK::Time internally

This commit is very invasive, because Thread likes to take a pointer and write
to it. This means that translating between timespec/timeval/Time would have been
more difficult than just changing everything that hands a raw pointer to Thread,
in bulk.
This commit is contained in:
Ben Wiederhake 2021-02-27 23:56:16 +01:00 committed by Andreas Kling
parent 65b36e42b8
commit 2b6546c40a
14 changed files with 66 additions and 82 deletions

View file

@ -55,7 +55,7 @@ public:
VERIFY(!is_queued());
}
timespec remaining() const;
Time remaining() const;
private:
TimerId m_id;
@ -92,8 +92,7 @@ public:
static TimerQueue& the();
TimerId add_timer(NonnullRefPtr<Timer>&&);
// FIXME: Should use AK::Time internally
RefPtr<Timer> add_timer_without_id(clockid_t, const timespec&, Function<void()>&&);
RefPtr<Timer> add_timer_without_id(clockid_t, const Time&, Function<void()>&&);
TimerId add_timer(clockid_t, timeval& timeout, Function<void()>&& callback);
bool cancel_timer(TimerId id);
bool cancel_timer(Timer&);