Support optional .trapexit callback

This commit is contained in:
Tony Garnock-Jones 2013-11-03 15:56:12 -05:00
parent 5b4ccede3c
commit 578e2debc6
1 changed files with 4 additions and 0 deletions

View File

@ -312,6 +312,10 @@ World.prototype.kill = function (pid, exn) {
} else {
console.log("Process exited", pid, exn);
}
var p = this.processTable[pid];
if (p && p.behavior.trapexit) {
this.asChild(pid, function () { return p.behavior.trapexit(exn); });
}
delete this.processTable[pid];
this.issueRoutingUpdate();
};