1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 11:55:12 +00:00

Kernel: Use Thread::from_tid() in more places

This commit is contained in:
Andreas Kling 2020-01-04 18:56:04 +01:00
parent 95ba0d5a02
commit 3a27790fa7
2 changed files with 16 additions and 53 deletions

View file

@ -794,11 +794,13 @@ void Thread::wake_from_queue()
Thread* Thread::from_tid(int tid)
{
ASSERT_INTERRUPTS_DISABLED();
InterruptDisabler disabler;
Thread* found_thread = nullptr;
Thread::for_each([&](auto& thread) {
if (thread.tid() == tid)
if (thread.tid() == tid) {
found_thread = &thread;
return IterationDecision::Break;
}
return IterationDecision::Continue;
});
return found_thread;