Remove race condition between assemble and prelude load prints

This commit was merged in pull request #1.
This commit is contained in:
2026-03-18 15:17:08 +00:00
parent 4000522b3a
commit 67fc1d8d7b
3 changed files with 16 additions and 8 deletions

3
emu.js
View File

@@ -54,10 +54,11 @@ class Emulator {
this.print("Assembling kernel ");
const dots = setInterval(() => this.print("."), DOT_INTERVAL_MS);
this.worker = new Worker('boot.js', { type: 'module' });
this.worker.postMessage(this.mem);
this.worker.postMessage({ type: "load", mem: this.mem });
this.worker.onmessage = (e) => {
clearInterval(dots);
this.print(" done\n");
this.worker.postMessage({ type: "boot" });
};
fetch('prelude.f')