Merge pull request #562 from bigeyex/feature/fix-deleted-clone-sequence-order

Fix the next thread is skipped after clone deleted
This commit is contained in:
Andrew Sliwinski authored and GitHub committed 2017-08-23 09:51:38 -04:00
commit d1af3ef808
3 files changed
+10

No files matched your search

+1
View File
@@ -662,6 +662,7 @@ class Runtime extends EventEmitter {
continue;
}
if (this.threads[i].target === target) {
this.threads[i].isKilled = true;
this._removeThread(this.threads[i]);
}
}
+3
View File
@@ -69,6 +69,9 @@ class Sequencer {
// Normal-mode thread: step.
this.stepThread(activeThread);
activeThread.warpTimer = null;
if (activeThread.isKilled) {
i--; // if the thread is removed from the list (killed), do not increase index
}
}
if (activeThread.status === Thread.STATUS_RUNNING) {
numActiveThreads++;
+6
View File
@@ -30,6 +30,12 @@ class Thread {
*/
this.status = 0; /* Thread.STATUS_RUNNING */
/**
* Whether the thread is killed in the middle of execution.
* @type {boolean}
*/
this.isKilled = false;
/**
* Target of this thread.
* @type {?Target}