Lifecycle management of threads #29

Merged
harraiken merged 240 commits from threads into master 2026-09-07 13:45:09 +02:00
2 changed files with 16 additions and 0 deletions
Showing only changes of commit 95ec18a1de - Show all commits

View File

@@ -19,6 +19,7 @@ namespace PS
{
public:
STATIC XTAPI XTSTATUS CreateIdleProcess(IN PKPROCESSOR_CONTROL_BLOCK Prcb);
STATIC XTFASTCALL PEPROCESS GetCurrentProcess(VOID);
};
}

View File

@@ -49,3 +49,18 @@ PS::Process::CreateIdleProcess(IN PKPROCESSOR_CONTROL_BLOCK Prcb)
/* Initialize IDLE thread */
return KE::KThread::InitializeIdleThread(IdleProcess, IdleThread, Prcb, AR::ProcessorSupport::GetBootStack());
}
/**
* Returns a pointer to the process object associated with the currently executing thread.
*
* @return This routine returns a pointer to the current process object.
*
* @since XT 1.0
*/
XTFASTCALL
PEPROCESS
PS::Process::GetCurrentProcess(VOID)
{
/* Return the current process */
return (PEPROCESS)KE::Processor::GetCurrentThread()->ApcState.Process;
}