From 135cf9abf4996e0ddbbbdaeaee33441bbbe2ca25 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 6 Oct 2024 06:14:51 +0000 Subject: IMP: Improve Kernel's documentation. --- dev/zka/src/UserProcessScheduler.cxx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'dev/zka/src/UserProcessScheduler.cxx') diff --git a/dev/zka/src/UserProcessScheduler.cxx b/dev/zka/src/UserProcessScheduler.cxx index 9f0a5a3f..00249896 100644 --- a/dev/zka/src/UserProcessScheduler.cxx +++ b/dev/zka/src/UserProcessScheduler.cxx @@ -59,15 +59,21 @@ namespace Kernel this->Exit(kErrorProcessFault); } + /***********************************************************************************/ //! @brief boolean operator, check status. + /***********************************************************************************/ + UserProcess::operator bool() { return this->Status != ProcessStatusKind::kDead; } + /***********************************************************************************/ /// @brief Gets the local last exit code. /// @note Not thread-safe. /// @return Int32 the last exit code. + /***********************************************************************************/ + const UInt32& UserProcess::GetExitCode() noexcept { return this->fLastExitCode; @@ -82,6 +88,10 @@ namespace Kernel return fLocalCode; } + /***********************************************************************************/ + /// @brief Wake process. + /***********************************************************************************/ + void UserProcess::Wake(const bool should_wakeup) { this->Status = @@ -175,13 +185,19 @@ namespace Kernel return No; } - /// @brief Gets the name of the current process.. + /***********************************************************************************/ + /// @brief Gets the name of the current process. + /***********************************************************************************/ + const Char* UserProcess::GetProcessName() noexcept { return this->Name; } + /***********************************************************************************/ /// @brief Gets the owner of the process. + /***********************************************************************************/ + const User* UserProcess::GetOwner() noexcept { return this->Owner; @@ -247,9 +263,12 @@ namespace Kernel UserProcessScheduler::The().Remove(this->ProcessId); } + /***********************************************************************************/ /// @brief Add process to list. /// @param process the process *Ref* class. /// @return the process index inside the team. + /***********************************************************************************/ + SizeT UserProcessScheduler::Add(UserProcess process) { if (mTeam.mProcessAmount > kSchedProcessLimitPerTeam) @@ -308,6 +327,8 @@ namespace Kernel return ret_pid; } + /***********************************************************************************/ + /// @brief Retrieves the singleton of the process scheduler. /***********************************************************************************/ UserProcessScheduler& UserProcessScheduler::The() -- cgit v1.2.3