more process management code
This commit is contained in:
parent
4d6cd7840a
commit
ff99686c97
@ -167,6 +167,9 @@ class System(Apex)
|
||||
3 -> application main
|
||||
the following loops starts from pid 3 up to 100. this is POC only. i need to write a proper enumeration methods and use them.
|
||||
*/
|
||||
|
||||
//Processor _suspendAllUserProcesses. <--- keep kernel processes alive.
|
||||
|
||||
pid := 3.
|
||||
while (pid < 100)
|
||||
{
|
||||
@ -381,6 +384,7 @@ TODO: how to pass all variadic arguments to another variadic methods???
|
||||
}
|
||||
|
||||
|
||||
// TODO: support Pointer arithmetic?
|
||||
class(#limited) SmallPointer(Object)
|
||||
{
|
||||
method(#primitive) asString.
|
||||
|
@ -2786,6 +2786,15 @@ static moo_pfrc_t pf_process_scheduler_process_by_id (moo_t* moo, moo_mod_t* mod
|
||||
return MOO_PF_FAILURE;
|
||||
}
|
||||
|
||||
static moo_pfrc_t pf_process_scheduler_suspend_all_user_processes (moo_t* moo, moo_mod_t* mod, moo_ooi_t nargs)
|
||||
{
|
||||
/* TODO: must exclude special inner processes */
|
||||
while (moo->processor->runnable.first)
|
||||
{
|
||||
suspend_process (moo, moo->processor->runnable.first);
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
static moo_pfrc_t pf_semaphore_signal (moo_t* moo, moo_mod_t* mod, moo_ooi_t nargs)
|
||||
{
|
||||
@ -4319,6 +4328,7 @@ static pf_t pftab[] =
|
||||
{ "MethodContext_goto:", { pf_context_goto, 1, 1 } },
|
||||
|
||||
{ "ProcessScheduler_processById:", { pf_process_scheduler_process_by_id, 1, 1 } },
|
||||
{ "ProcessScheduler_suspendAllUserProcesses", { pf_process_scheduler_suspend_all_user_processes, 0, 0 } },
|
||||
|
||||
{ "Process_resume", { pf_process_resume, 0, 0 } },
|
||||
{ "Process_sp", { pf_process_sp, 0, 0 } },
|
||||
|
Loading…
Reference in New Issue
Block a user