1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

Kernel: Unify Kernel task names for consistency

This change unifies the naming convention for kernel tasks.

The goal of this change is to:

- Make the task names more descriptive, so users can more
  easily understand their purpose in System Monitor.

- Unify the naming convention so they are consistent.
This commit is contained in:
Brian Gianforcaro 2022-06-04 21:44:48 -07:00 committed by Linus Groh
parent 5fd3716e2f
commit 6b85b358f8
6 changed files with 10 additions and 8 deletions

View file

@ -509,7 +509,7 @@ size_t UHCIController::poll_transfer_queue(QueueHead& transfer_queue)
ErrorOr<void> UHCIController::spawn_port_process() ErrorOr<void> UHCIController::spawn_port_process()
{ {
RefPtr<Thread> usb_hotplug_thread; RefPtr<Thread> usb_hotplug_thread;
(void)Process::create_kernel_process(usb_hotplug_thread, TRY(KString::try_create("UHCI hotplug")), [&] { (void)Process::create_kernel_process(usb_hotplug_thread, TRY(KString::try_create("UHCI Hot Plug Task")), [&] {
for (;;) { for (;;) {
if (m_root_hub) if (m_root_hub)
m_root_hub->check_for_port_updates(); m_root_hub->check_for_port_updates();

View file

@ -43,7 +43,7 @@ static HashTable<RefPtr<TCPSocket>>* delayed_ack_sockets;
void NetworkTask::spawn() void NetworkTask::spawn()
{ {
RefPtr<Thread> thread; RefPtr<Thread> thread;
auto name = KString::try_create("NetworkTask"); auto name = KString::try_create("Network Task");
if (name.is_error()) if (name.is_error())
TODO(); TODO();
(void)Process::create_kernel_process(thread, name.release_value(), NetworkTask_main, nullptr); (void)Process::create_kernel_process(thread, name.release_value(), NetworkTask_main, nullptr);

View file

@ -405,7 +405,7 @@ UNMAP_AFTER_INIT void Scheduler::initialize()
VERIFY(s_colonel_process); VERIFY(s_colonel_process);
VERIFY(idle_thread); VERIFY(idle_thread);
idle_thread->set_priority(THREAD_PRIORITY_MIN); idle_thread->set_priority(THREAD_PRIORITY_MIN);
idle_thread->set_name(KString::must_create("idle thread #0")); idle_thread->set_name(KString::must_create("Idle Task #0"));
set_idle_thread(idle_thread); set_idle_thread(idle_thread);
} }

View file

@ -11,6 +11,8 @@
namespace Kernel { namespace Kernel {
static constexpr StringView finalizer_task_name = "Finalizer Task"sv;
static void finalizer_task(void*) static void finalizer_task(void*)
{ {
Thread::current()->set_priority(THREAD_PRIORITY_LOW); Thread::current()->set_priority(THREAD_PRIORITY_LOW);
@ -20,14 +22,14 @@ static void finalizer_task(void*)
if (g_finalizer_has_work.exchange(false, AK::MemoryOrder::memory_order_acq_rel) == true) if (g_finalizer_has_work.exchange(false, AK::MemoryOrder::memory_order_acq_rel) == true)
Thread::finalize_dying_threads(); Thread::finalize_dying_threads();
else else
g_finalizer_wait_queue->wait_forever("FinalizerTask"); g_finalizer_wait_queue->wait_forever(finalizer_task_name);
} }
}; };
UNMAP_AFTER_INIT void FinalizerTask::spawn() UNMAP_AFTER_INIT void FinalizerTask::spawn()
{ {
RefPtr<Thread> finalizer_thread; RefPtr<Thread> finalizer_thread;
auto finalizer_process = Process::create_kernel_process(finalizer_thread, KString::must_create("FinalizerTask"), finalizer_task, nullptr); auto finalizer_process = Process::create_kernel_process(finalizer_thread, KString::must_create(finalizer_task_name), finalizer_task, nullptr);
VERIFY(finalizer_process); VERIFY(finalizer_process);
g_finalizer = finalizer_thread; g_finalizer = finalizer_thread;
} }

View file

@ -15,8 +15,8 @@ namespace Kernel {
UNMAP_AFTER_INIT void SyncTask::spawn() UNMAP_AFTER_INIT void SyncTask::spawn()
{ {
RefPtr<Thread> syncd_thread; RefPtr<Thread> syncd_thread;
(void)Process::create_kernel_process(syncd_thread, KString::must_create("SyncTask"), [] { (void)Process::create_kernel_process(syncd_thread, KString::must_create("VFS Sync Task"), [] {
dbgln("SyncTask is running"); dbgln("VFS SyncTask is running");
for (;;) { for (;;) {
VirtualFileSystem::sync(); VirtualFileSystem::sync();
(void)Thread::current()->sleep(Time::from_seconds(1)); (void)Thread::current()->sleep(Time::from_seconds(1));

View file

@ -16,7 +16,7 @@ WorkQueue* g_io_work;
UNMAP_AFTER_INIT void WorkQueue::initialize() UNMAP_AFTER_INIT void WorkQueue::initialize()
{ {
g_io_work = new WorkQueue("IO WorkQueue"); g_io_work = new WorkQueue("IO WorkQueue Task");
} }
UNMAP_AFTER_INIT WorkQueue::WorkQueue(StringView name) UNMAP_AFTER_INIT WorkQueue::WorkQueue(StringView name)