diff --git a/src/kernel/ps/ProcessManager.hx b/src/kernel/ps/ProcessManager.hx index 1e71d1a..7001ea7 100644 --- a/src/kernel/ps/ProcessManager.hx +++ b/src/kernel/ps/ProcessManager.hx @@ -2,6 +2,8 @@ package kernel.ps; import kernel.ps.ProcessHandle.HandleConfig; +using tink.CoreApi; + typedef PID = Int; class ProcessManager { @@ -18,6 +20,16 @@ class ProcessManager { return pid; } + public static function kill(pid: PID) { + if (!processList.exists(pid)){ + throw new Error("Process with PID " + pid + " does not exist"); + } + + var handle = processList.get(pid); + + handle.close(); + } + private static function createPID(): PID { // TODO: better PID generation