Merge pull request from mzgoddard/sequencer-thread-cleanup

Sequencer thread cleanup
This commit is contained in:
Karishma Chadha 2018-11-07 17:15:11 -05:00 committed by GitHub
commit 4bb2d19584
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 98 additions and 59 deletions
src/engine

View file

@ -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) {