core: synchronize global .init before first .tick
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
2c73f8c518
commit
4ba8addb3c
2 changed files with 8 additions and 0 deletions
|
|
@ -14,6 +14,12 @@ pub fn initModule() !void {
|
|||
// Initialize the global set of Mach modules used in the program.
|
||||
try mods.init(std.heap.c_allocator);
|
||||
mods.mod.mach_core.send(.init, .{});
|
||||
|
||||
// Dispatch events until this .mach_core.init_done is sent
|
||||
try mods.dispatch(.{ .until = .{
|
||||
.module_name = mods.moduleNameToID(.mach_core),
|
||||
.local_event = mods.localEventToID(.mach_core, .init_done),
|
||||
} });
|
||||
}
|
||||
|
||||
/// Tick runs a single step of the main loop on the main OS thread.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue