mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +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:
committed by
Andreas Kling
parent
fe7b08dad7
commit
1014aefe64
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user