mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-28 06:59:45 -04:00
Add isActiveThread
and simplify broadcast-and-wait accordingly
This commit is contained in:
parent
64b82f4dc2
commit
40c90bbcc7
2 changed files with 13 additions and 8 deletions
src/engine
|
@ -211,6 +211,15 @@ Runtime.prototype._removeThread = function (thread) {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Return whether a thread is currently active/running.
|
||||
* @param {?Thread} thread Thread object to check.
|
||||
* @return {Boolean} True if the thread is active/running.
|
||||
*/
|
||||
Runtime.prototype.isActiveThread = function (thread) {
|
||||
return this.threads.indexOf(thread) > -1;
|
||||
};
|
||||
|
||||
/**
|
||||
* Toggle a script.
|
||||
* @param {!string} topBlockId ID of block that starts the script.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue