summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-11-20 14:21:56 +0100
committerjmoenig <jens@moenig.org>2014-11-20 14:21:56 +0100
commit5771e93fa150c9a39e84bd9fad0e8a0bd2d61085 (patch)
tree098a0e1b8dfc7183c491581059f304cff44cb821
parent89c2835130e5f77e92c35c52b26d58370be07a7c (diff)
downloadsnap-yow-5771e93fa150c9a39e84bd9fad0e8a0bd2d61085.tar.gz
snap-yow-5771e93fa150c9a39e84bd9fad0e8a0bd2d61085.zip
Fixed #364 avoid “freezing” when calling LAUNCH on empty ring
-rwxr-xr-xhistory.txt3
-rw-r--r--threads.js10
2 files changed, 9 insertions, 4 deletions
diff --git a/history.txt b/history.txt
index 53bd4a6..c26599c 100755
--- a/history.txt
+++ b/history.txt
@@ -2324,4 +2324,5 @@ ______
141120
------
-* Lists: Fixed #642, avoid “freezing” when calling CONS on non-list/null
+* Lists: Fixed #642 avoid “freezing” when calling CONS on non-list/null
+* Threads: Fixed #364 avoid “freezing” when calling LAUNCH on empty ring
diff --git a/threads.js b/threads.js
index cf97362..c6b0fde 100644
--- a/threads.js
+++ b/threads.js
@@ -83,7 +83,7 @@ ArgLabelMorph, localize, XML_Element, hex_sha512*/
// Global stuff ////////////////////////////////////////////////////////
-modules.threads = '2014-November-17';
+modules.threads = '2014-November-20';
var ThreadManager;
var Process;
@@ -225,8 +225,9 @@ ThreadManager.prototype.removeTerminatedProcesses = function () {
var remaining = [];
this.processes.forEach(function (proc) {
if (!proc.isRunning() && !proc.errorFlag && !proc.isDead) {
- proc.topBlock.removeHighlight();
-
+ if (proc.topBlock instanceof BlockMorph) {
+ proc.topBlock.removeHighlight();
+ }
if (proc.prompter) {
proc.prompter.destroy();
if (proc.homeContext.receiver.stopTalking) {
@@ -880,6 +881,9 @@ Process.prototype.fork = function (context, args) {
'continuations cannot be forked'
);
}
+ if (!(context instanceof Context)) {
+ throw new Error('expecting a ring but getting ' + context);
+ }
var outer = new Context(null, null, context.outerContext),
runnable = new Context(null,