diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -888,13 +888,25 @@ pub fn build(b: *std.Build) void { \\} \\ ; + // And its event queue: a pop that makes room woke one blocked + // writer, and only on the pop from full. The tty has two writers + // (a pane's pty reader, and the input reader posting the frame + // ack's wake), so when the loop emptied a full queue in one batch + // the writer not woken waited on for good: under `yes` the pane + // stopped being read, its program blocked on the pty, while keys + // went on working. Every blocked writer is woken now. + var queue_src = configureRead(b, io, vaxis_dep.builder.root, "src/queue.zig", 1 << 20) catch @panic("read vaxis queue.zig"); + const wake_one = "self.not_full.signal(self.io);"; + if (std.mem.count(u8, queue_src, wake_one) != 2) std.debug.panic("vaxis's queue.zig changed at `{s}`: redo its patch in build.zig", .{wake_one}); + queue_src = std.mem.replaceOwned(u8, b.allocator, queue_src, wake_one, "self.not_full.broadcast(self.io); // pardes's patch (its build.zig)") catch @panic("OOM"); const files = b.addWriteFiles(); _ = files.add("Parser.zig", b.fmt("{s}{s}", .{ src, cursor_report })); _ = files.add("Vaxis.zig", b.fmt("{s}{s}", .{ render_src, blank_ink })); + _ = files.add("queue.zig", queue_src); _ = files.addCopyFile(vaxis_dep.path("src/widgets/terminal/Parser.zig"), "widgets/terminal/Parser.zig"); - // Suffixes: this leaves out both Parser.zig files and Vaxis.zig, - // written above. - _ = files.addCopyDirectory(vaxis_dep.path("src"), "", .{ .exclude_extensions = &.{ "Parser.zig", "Vaxis.zig" } }); + // Suffixes: this leaves out both Parser.zig files, Vaxis.zig and + // queue.zig, written above. + _ = files.addCopyDirectory(vaxis_dep.path("src"), "", .{ .exclude_extensions = &.{ "Parser.zig", "Vaxis.zig", "queue.zig" } }); vaxis_mod.root_source_file = files.getDirectory().path(b, "main.zig"); } |
