mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-10 21:39:57 -04:00
Merge pull request #1683 from mzgoddard/sequencer-thread-cleanup
Sequencer thread cleanup
This commit is contained in:
commit
4bb2d19584
7 changed files with 98 additions and 59 deletions
src/engine
|
@ -241,6 +241,13 @@ class Runtime extends EventEmitter {
|
|||
*/
|
||||
this._nonMonitorThreadCount = 0;
|
||||
|
||||
/**
|
||||
* All threads that finished running and were removed from this.threads
|
||||
* by behaviour in Sequencer.stepThreads.
|
||||
* @type {Array<Thread>}
|
||||
*/
|
||||
this._lastStepDoneThreads = null;
|
||||
|
||||
/**
|
||||
* Currently known number of clones, used to enforce clone limit.
|
||||
* @type {number}
|
||||
|
@ -1663,6 +1670,9 @@ class Runtime extends EventEmitter {
|
|||
this._emitProjectRunStatus(
|
||||
this.threads.length + doneThreads.length -
|
||||
this._getMonitorThreadCount([...this.threads, ...doneThreads]));
|
||||
// Store threads that completed this iteration for testing and other
|
||||
// internal purposes.
|
||||
this._lastStepDoneThreads = doneThreads;
|
||||
if (this.renderer) {
|
||||
// @todo: Only render when this.redrawRequested or clones rendered.
|
||||
if (this.profiler !== null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue