Skip to content

Commit 47fe812

Browse files
committed
Skip execution of dead threads
1 parent 7720a2e commit 47fe812

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rt/src/Scheduler.mts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ export class Scheduler implements SchedulerInterface {
269269
for (let i = 0; i < maxThreadsPerLoop && this.__funloop.length > 0; ++i) {
270270
// Pop front of function queue and set it to be the next thread.
271271
this.__currentThread = this.__funloop.shift();
272+
if (!this.__alive[this.__currentThread.tid.val.toString()]) { continue; }
273+
272274
dest = this.__currentThread.next;
273275

274276
// Run thread for `maxKontsPerThread` continuations.

0 commit comments

Comments
 (0)