diff options
| author | Jens Mönig <jens@moenig.org> | 2014-01-08 06:49:31 -0800 |
|---|---|---|
| committer | Jens Mönig <jens@moenig.org> | 2014-01-08 06:49:31 -0800 |
| commit | 1da3ae32aaf3eb45564c04d6e0a2d0067829fe7c (patch) | |
| tree | 863820b6528fd817e5e4b36dd3639d4de2adc4fd /threads.js | |
| parent | 82c03bae77ae8afa8c364de30c8940a3de402e7a (diff) | |
| parent | d8d1810e436cba83144f4b2234fc3097a739208b (diff) | |
| download | snap-yow-1da3ae32aaf3eb45564c04d6e0a2d0067829fe7c.tar.gz snap-yow-1da3ae32aaf3eb45564c04d6e0a2d0067829fe7c.zip | |
Merge pull request #283 from Hardmath123/master
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 |
