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:
Michael "Z" Goddard 2017-11-07 14:15:53 -05:00
parent 9df3b8ad86
commit 9864403bc9
No known key found for this signature in database
GPG key ID: 762CD40DD5349872

View file

@ -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);
}
/**