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

Kernel: Protect Thread::m_name with a spinlock

This replaces manually grabbing the thread's main lock.

This lets us remove the `get_thread_name` and `set_thread_name` syscalls
from the big lock. :^)
This commit is contained in:
Sam Atkins 2023-02-04 14:11:35 +00:00 committed by Andreas Kling
parent fe7b08dad7
commit 1014aefe64
5 changed files with 27 additions and 27 deletions

View file

@ -1466,6 +1466,14 @@ void Thread::track_lock_release(LockRank rank)
m_lock_rank_mask ^= rank;
}
void Thread::set_name(NonnullOwnPtr<KString> name)
{
m_name.with([&](auto& this_name) {
this_name = move(name);
});
}
}
ErrorOr<void> AK::Formatter<Kernel::Thread>::format(FormatBuilder& builder, Kernel::Thread const& value)