mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
Kernel: Add a Thread::all_threads() helper.
This commit is contained in:
@@ -522,3 +522,12 @@ void Thread::initialize()
|
||||
g_threads = new InlineLinkedList<Thread>;
|
||||
Scheduler::initialize();
|
||||
}
|
||||
|
||||
Vector<Thread*> Thread::all_threads()
|
||||
{
|
||||
Vector<Thread*> threads;
|
||||
InterruptDisabler disabler;
|
||||
for (auto* thread = g_threads->head(); thread; thread = thread->next())
|
||||
threads.append(thread);
|
||||
return threads;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user