mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-12 22:42:03 -04:00
A thread in the runtime but with the DONE status is not active
return false from isActiveThread if thread's status is done even when its contained in the runtime threads list. As it is done, the thread will not be run until either its replaced by a new copy of the thread or the thread is removed from the list and another is added at a later time.
This commit is contained in:
parent
9df3b8ad86
commit
9864403bc9
1 changed files with 5 additions and 1 deletions
|
@ -825,7 +825,11 @@ class Runtime extends EventEmitter {
|
|||
* @return {boolean} True if the thread is active/running.
|
||||
*/
|
||||
isActiveThread (thread) {
|
||||
return this.threads.indexOf(thread) > -1;
|
||||
return (
|
||||
(
|
||||
thread.stack.length > 0 &&
|
||||
thread.status !== Thread.STATUS_DONE) &&
|
||||
this.threads.indexOf(thread) > -1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue