Skip to content

Commit

Permalink
fixed a regression conflict between "when I am stopped" and broadcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoenig committed Jul 19, 2018
1 parent 03b1e5f commit 62eedb8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ isRetinaSupported, SliderMorph, Animation, BoxMorph, MediaRecorder*/

// Global stuff ////////////////////////////////////////////////////////

modules.gui = '2018-July-13';
modules.gui = '2018-July-19';

// Declarations

Expand Down Expand Up @@ -3513,7 +3513,7 @@ IDE_Morph.prototype.aboutSnap = function () {
module, btn1, btn2, btn3, btn4, licenseBtn, translatorsBtn,
world = this.world();

aboutTxt = 'Snap! 4.2.1.2\nBuild Your Own Blocks\n\n'
aboutTxt = 'Snap! 4.2.1.3\nBuild Your Own Blocks\n\n'
+ 'Copyright \u24B8 2018 Jens M\u00F6nig and '
+ 'Brian Harvey\n'
+ 'jens@moenig.org, bh@cs.berkeley.edu\n\n'
Expand Down
7 changes: 7 additions & 0 deletions history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4293,5 +4293,12 @@ Fixes:
* eliminated false "reporter didn't report" error messages


180719
------
* Threads: fixed a regression conflict between "when I am stopped" and broadcasts

=== v4.2.1.3 maintenance release ===


=== in development ===

6 changes: 3 additions & 3 deletions snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Snap! Build Your Own Blocks 4.2.1.2</title>
<title>Snap! Build Your Own Blocks 4.2.1.3</title>
<link rel="shortcut icon" href="favicon.ico">
<script type="text/javascript" src="morphic.js?version=2018-06-21"></script>
<script type="text/javascript" src="widgets.js?version=2018-06-21"></script>
<script type="text/javascript" src="blocks.js?version=2018-07-13"></script>
<script type="text/javascript" src="threads.js?version=2018-07-12"></script>
<script type="text/javascript" src="threads.js?version=2018-07-19"></script>
<script type="text/javascript" src="objects.js?version=2018-07-06"></script>
<script type="text/javascript" src="gui.js?version=2018-07-13"></script>
<script type="text/javascript" src="gui.js?version=2018-07-19"></script>
<script type="text/javascript" src="paint.js?version=2018-06-21"></script>
<script type="text/javascript" src="lists.js?version=2018-06-21"></script>
<script type="text/javascript" src="byob.js?version=2018-06-21"></script>
Expand Down
8 changes: 6 additions & 2 deletions threads.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ StageMorph, SpriteMorph, StagePrompterMorph, Note, modules, isString, copy,
isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph,
TableFrameMorph, ColorSlotMorph, isSnapObject*/

modules.threads = '2018-July-12';
modules.threads = '2018-July-19';

var ThreadManager;
var Process;
Expand Down Expand Up @@ -217,6 +217,7 @@ ThreadManager.prototype.startProcess = function (
return active;
}
active.stop();
active.canBroadcast = true; // broadcasts to fire despite reentrancy
this.removeTerminatedProcesses();
}
newProc = new Process(top, receiver, callback, isClicked);
Expand Down Expand Up @@ -528,6 +529,7 @@ ThreadManager.prototype.toggleSingleStepping = function () {
invocations can catch them
flashingContext for single stepping
isInterrupted boolean, indicates intra-step flashing of blocks
canBroadcast boolean, used to control reentrancy & "when stopped"
*/

Process.prototype = {};
Expand Down Expand Up @@ -565,6 +567,7 @@ function Process(topBlock, receiver, onComplete, yieldFirst) {
this.procedureCount = 0;
this.flashingContext = null; // experimental, for single-stepping
this.isInterrupted = false; // experimental, for single-stepping
this.canBroadcast = true; // used to control "when I am stopped"

if (topBlock) {
this.homeContext.variables.parentFrame =
Expand Down Expand Up @@ -648,6 +651,7 @@ Process.prototype.stop = function () {
if (this.context) {
this.context.stopMusic();
}
this.canBroadcast = false;
};

Process.prototype.pause = function () {
Expand Down Expand Up @@ -2324,7 +2328,7 @@ Process.prototype.doBroadcast = function (message) {
myself = this,
procs = [];

if (this.readyToTerminate) {
if (!this.canBroadcast) {
return [];
}
if (message instanceof List && (message.length() === 2)) {
Expand Down

0 comments on commit 62eedb8

Please sign in to comment.