From 29c59abf7da7283c49411626975442f8eb10cfb5 Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 30 Oct 2022 19:28:43 +0100 Subject: [PATCH] Kernel: Rename blocking_wait_info's wait_pid to pid --- kernel/include/thread/Task.h | 2 +- kernel/src/thread/Scheduler.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/include/thread/Task.h b/kernel/include/thread/Task.h index 2882df94..60b16ebe 100644 --- a/kernel/include/thread/Task.h +++ b/kernel/include/thread/Task.h @@ -92,7 +92,7 @@ struct Task } blocking_read_info; struct { - int64_t wait_pid; + int64_t pid; int* wstatus; } blocking_wait_info; }; diff --git a/kernel/src/thread/Scheduler.cpp b/kernel/src/thread/Scheduler.cpp index ac5f9168..a52ba639 100644 --- a/kernel/src/thread/Scheduler.cpp +++ b/kernel/src/thread/Scheduler.cpp @@ -498,7 +498,7 @@ void sys_waitpid(Context* context, long pid, int* wstatus, kdbgln("blocking wait on any child"); sched_current_task->state = sched_current_task->Blocking; sched_current_task->block_reason = BlockReason::Waiting; - sched_current_task->blocking_wait_info.wait_pid = -1; + sched_current_task->blocking_wait_info.pid = -1; if (wstatus) sched_current_task->blocking_wait_info.wstatus = kwstatus; else sched_current_task->blocking_wait_info.wstatus = nullptr; @@ -539,7 +539,7 @@ void sys_waitpid(Context* context, long pid, int* wstatus, } sched_current_task->state = sched_current_task->Blocking; sched_current_task->block_reason = BlockReason::Waiting; - sched_current_task->blocking_wait_info.wait_pid = pid; + sched_current_task->blocking_wait_info.pid = pid; if (wstatus) sched_current_task->blocking_wait_info.wstatus = kwstatus; else sched_current_task->blocking_wait_info.wstatus = nullptr; @@ -568,7 +568,7 @@ void sys_waitpid(Context* context, long pid, int* wstatus, bool Task::is_wait_still_blocking() { Task* child = nullptr; - if (blocking_wait_info.wait_pid == -1) + if (blocking_wait_info.pid == -1) { sched_for_each_child(sched_current_task, [&](Task* task) { if (task->state == task->Dying) @@ -581,13 +581,13 @@ bool Task::is_wait_still_blocking() if (!child) return true; else { - blocking_wait_info.wait_pid = child->id; // We're committed to this child now. + blocking_wait_info.pid = child->id; // We're committed to this child now. return false; } } else { - child = Scheduler::find_by_pid(blocking_wait_info.wait_pid); + child = Scheduler::find_by_pid(blocking_wait_info.pid); ASSERT(child); // since sys_waitpid should have validated this child, and the only way for it to disappear from // the process list is for someone to wait for it, this should be pretty safe. if (child->state != child->Dying) return true; @@ -598,9 +598,9 @@ bool Task::is_wait_still_blocking() void Task::resume_wait() { - ASSERT(blocking_wait_info.wait_pid != -1); // is_wait_still_blocking should have chosen a child for us if the user - // process told us to wait for any child. - Task* child = Scheduler::find_by_pid(blocking_wait_info.wait_pid); + ASSERT(blocking_wait_info.pid != -1); // is_wait_still_blocking should have chosen a child for us if the user + // process told us to wait for any child. + Task* child = Scheduler::find_by_pid(blocking_wait_info.pid); ASSERT(child); // This should also already have been validated. if (blocking_wait_info.wstatus)