mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-06 19:41:51 -04:00
Add thread management and stepping to runtime
This commit is contained in:
parent
dbfb3356c6
commit
92dab97b84
5 changed files with 610 additions and 376 deletions
src/engine
|
@ -1,9 +1,14 @@
|
|||
function Thread () {
|
||||
/**
|
||||
* A thread is a running stack context and all the metadata needed.
|
||||
* @param {?string} firstBlock First block to execute in the thread.
|
||||
* @constructor
|
||||
*/
|
||||
function Thread (firstBlock) {
|
||||
/**
|
||||
* Next block that the thread will execute.
|
||||
* @type {string}
|
||||
*/
|
||||
this.nextBlock = null;
|
||||
this.nextBlock = firstBlock;
|
||||
/**
|
||||
* Stack for the thread. When the sequencer enters a control structure,
|
||||
* the block is pushed onto the stack so we know where to exit.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue