added example turtle program
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package kernel.binstore;
|
||||
|
||||
import bin.turtle.Patrol;
|
||||
import bin.pathfinder.PFClient;
|
||||
import bin.ID;
|
||||
import bin.exporter.Res;
|
||||
@@ -41,7 +42,8 @@ class BinStore {
|
||||
{c: ResManager, name: "ResManager", aliases: ["resmanager", "resmgr"]},
|
||||
{c: Res, name: "Res", aliases: ["res"]},
|
||||
{c: ID, name: "ID", aliases: ["id"]},
|
||||
{c: PFClient, name: "PFClient", aliases: ["pfclient"]}
|
||||
{c: PFClient, name: "PFClient", aliases: ["pfclient"]},
|
||||
{c: Patrol, name: "Patrol", aliases: ["patrol"]}
|
||||
];
|
||||
|
||||
public static function getBinByName(name:String):Null<Bin> {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package kernel.ps;
|
||||
|
||||
import kernel.turtle.TurtleMutex;
|
||||
import kernel.ps.ProcessManager.PID;
|
||||
import kernel.ui.WindowContext;
|
||||
import kernel.ui.WindowManager;
|
||||
@@ -104,7 +105,19 @@ class ProcessHandle {
|
||||
this.deferFuncs.push(func);
|
||||
}
|
||||
|
||||
function get_args():ReadOnlyArray<String> {
|
||||
public function get_args():ReadOnlyArray<String> {
|
||||
return this.config.args;
|
||||
}
|
||||
|
||||
public function claimTurtleMutex():Bool {
|
||||
if (TurtleMutex.claim(this.pid)) {
|
||||
this.addDeferFunc(() -> {
|
||||
TurtleMutex.release(this.pid);
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ class TurtleMutex {
|
||||
private static function release(pid:PID) {
|
||||
if (claimedPid == pid) {
|
||||
claimedPid = -1;
|
||||
stopTurtleThread();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user