diff options
| author | Hardmath123 <hardmath123@gmail.com> | 2013-12-22 16:28:11 -0800 |
|---|---|---|
| committer | Hardmath123 <hardmath123@gmail.com> | 2013-12-22 16:28:11 -0800 |
| commit | d8d1810e436cba83144f4b2234fc3097a739208b (patch) | |
| tree | c4e06a216c75de15dc065cb3ceb05261e8e25187 /threads.js | |
| parent | e9020b4ed3f7190dc78e622fbe3b2665e227c30f (diff) | |
| download | snap-yow-d8d1810e436cba83144f4b2234fc3097a739208b.tar.gz snap-yow-d8d1810e436cba83144f4b2234fc3097a739208b.zip | |
Initial stop others block
Diffstat (limited to 'threads.js')
| -rw-r--r-- | threads.js | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -168,6 +168,17 @@ ThreadManager.prototype.stopAllForReceiver = function (rcvr) { }); }; +ThreadManager.prototype.stopAllForReceiverExcept = function (rcvr, excpt) { + this.processes.forEach(function (proc) { + if (proc.homeContext.receiver === rcvr && proc != excpt) { + proc.stop(); + if (rcvr.isClone) { + proc.isDead = true; + } + } + }); +}; + ThreadManager.prototype.stopProcess = function (block) { var active = this.findProcess(block); if (active) { @@ -1368,6 +1379,16 @@ Process.prototype.doStopAll = function () { } }; +Process.prototype.doStopOthers = function () { + var stage, ide; + if (this.homeContext.receiver) { + stage = this.homeContext.receiver.parentThatIsA(StageMorph); + if (stage) { + stage.threads.stopAllForReceiverExcept(this.homeContext.receiver, this); + } + } +}; + Process.prototype.doWarp = function (body) { // execute my contents block atomically (more or less) var outer = this.context.outerContext, // for tail call elimination |
