From 4d8d538c9ab3b948d64181ce9c0619fa826091f9 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Sat, 8 Jun 2024 20:02:02 +0200 Subject: [PATCH] fix(windows): force no-sleep mode on windows This is possibly just a workaround. Sleeping on windows causes the task queue to run empty even though we have pending async reads. This is possibly an issue with asio on windows that may be difficult to fix properly. For now we just disable sleeping altogether and leave the frame metronome running which will keep flow alive. --- src/main.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.zig b/src/main.zig index 063fc15..c78157c 100644 --- a/src/main.zig +++ b/src/main.zig @@ -138,7 +138,7 @@ pub fn main() anyerror!void { env.set("no-alternate", (res.args.@"no-alternate" != 0)); env.set("show-input", (res.args.@"show-input" != 0)); env.set("show-log", (res.args.@"show-log" != 0)); - env.set("no-sleep", (res.args.@"no-sleep" != 0)); + env.set("no-sleep", (builtin.os.tag == .windows or res.args.@"no-sleep" != 0)); env.set("dump-stack-trace", (res.args.@"debug-dump-on-error" != 0)); if (res.args.@"frame-rate") |s| env.num_set("frame-rate", @intCast(s)); env.proc_set("log", log_proc.ref());