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:
commit
d1af3ef808
3 files changed
+10
No files matched your search
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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++;
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in new issue
Block a user