added kill to ProcessManager
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user