if (thread.isBusy) {
return false
}
- return true
}
+ return true
}
constructor (url: string | URL) {
worker: new Worker(new URL(url, import.meta.url), { type: 'module' })
}
thread.worker.addEventListener('message', (message) => {
- thread.isBusy = false
this.#report(thread, message.data ?? message)
})
this.#threads.push(thread)
#report (thread: Thread, result: any) {
this.#results.push(result)
+ thread.isBusy = false
if (this.#queue.length > 0) {
this.#assign(thread)
} else if (this.isDone) {