mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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:
parent
65b36e42b8
commit
2b6546c40a
Notes:
sideshowbarker
2024-07-18 21:47:49 +09:00
Author: https://github.com/BenWiederhake
Commit: 2b6546c40a
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
14 changed files with 66 additions and 82 deletions
|
@ -333,13 +333,13 @@ void Thread::relock_process(LockMode previous_locked, u32 lock_count_to_restore)
|
|||
}
|
||||
}
|
||||
|
||||
auto Thread::sleep(clockid_t clock_id, const timespec& duration, timespec* remaining_time) -> BlockResult
|
||||
auto Thread::sleep(clockid_t clock_id, const Time& duration, Time* remaining_time) -> BlockResult
|
||||
{
|
||||
VERIFY(state() == Thread::Running);
|
||||
return Thread::current()->block<Thread::SleepBlocker>({}, Thread::BlockTimeout(false, &duration, nullptr, clock_id), remaining_time);
|
||||
}
|
||||
|
||||
auto Thread::sleep_until(clockid_t clock_id, const timespec& deadline) -> BlockResult
|
||||
auto Thread::sleep_until(clockid_t clock_id, const Time& deadline) -> BlockResult
|
||||
{
|
||||
VERIFY(state() == Thread::Running);
|
||||
return Thread::current()->block<Thread::SleepBlocker>({}, Thread::BlockTimeout(true, &deadline, nullptr, clock_id));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue