Kernel: Stop using *LockRefPtr for Thread

These were stored in a bunch of places. The main one that's a bit iffy
is the Mutex::m_holder one, which I'm going to simplify in a subsequent
commit.

In Plan9FS and WorkQueue, we can't make the NNRPs const due to
initialization order problems. That's probably doable with further
cleanup, but left as an exercise for our future selves.

Before starting this, I expected the thread blockers to be a problem,
but as it turns out they were super straightforward (for once!) as they
don't mutate the thread after initiating a block, so they can just use
simple const-ified NNRPs.
This commit is contained in:
Andreas Kling 2023-04-02 20:40:47 +02:00
parent a098266ff5
commit c3915e4058
Notes: sideshowbarker 2024-07-17 23:02:37 +09:00
9 changed files with 26 additions and 30 deletions

View file

@ -43,7 +43,7 @@ ErrorOr<FlatPtr> Process::sys$create_thread(void* (*entry)(void*), Userspace<Sys
// FIXME: Do something with guard pages?
auto thread = TRY(Thread::try_create(*this));
auto thread = TRY(Thread::create(*this));
// We know this thread is not the main_thread,
// So give it a unique name until the user calls $set_thread_name on it