1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 19:15:07 +00:00

Kernel: Stop using *LockRefPtr for Kernel::Timer

This commit is contained in:
Andreas Kling 2023-04-03 13:09:38 +02:00
parent 83b409083b
commit 496d918e92
9 changed files with 42 additions and 39 deletions

View file

@ -44,13 +44,13 @@ ErrorOr<NonnullRefPtr<Thread>> Thread::create(NonnullRefPtr<Process> process)
auto kernel_stack_region = TRY(MM.allocate_kernel_region(default_kernel_stack_size, {}, Memory::Region::Access::ReadWrite, AllocationStrategy::AllocateNow));
kernel_stack_region->set_stack(true);
auto block_timer = TRY(try_make_lock_ref_counted<Timer>());
auto block_timer = TRY(try_make_ref_counted<Timer>());
auto name = TRY(process->name().with([](auto& name) { return name->try_clone(); }));
return adopt_nonnull_ref_or_enomem(new (nothrow) Thread(move(process), move(kernel_stack_region), move(block_timer), move(name)));
}
Thread::Thread(NonnullRefPtr<Process> process, NonnullOwnPtr<Memory::Region> kernel_stack_region, NonnullLockRefPtr<Timer> block_timer, NonnullOwnPtr<KString> name)
Thread::Thread(NonnullRefPtr<Process> process, NonnullOwnPtr<Memory::Region> kernel_stack_region, NonnullRefPtr<Timer> block_timer, NonnullOwnPtr<KString> name)
: m_process(move(process))
, m_kernel_stack_region(move(kernel_stack_region))
, m_name(move(name))