summaryrefslogtreecommitdiff
path: root/src/fs.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-27 20:09:02 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit28c814aa5cfea23e8950ef007916ffc5d089288d (patch)
tree6e8c017c2140e1e7e8d0f3ee584a7f4aee1050f8 /src/fs.zig
parentc1be5b6b7c11f5dc17fd221c8d01b5693d0ffd0b (diff)
downloadpardes-28c814aa5cfea23e8950ef007916ffc5d089288d.tar.gz
pardes-28c814aa5cfea23e8950ef007916ffc5d089288d.zip
Hold a read that has nothing yet and answer it when its file has news
A following log, event, pty/data or a pty/run before its answer used to answer .again and wait for a wakeAll, which only the parked-write path asked for, so the band-aid had every queue push set turn.parked. Now the core keeps such a read (ctlfs.hold) and, as the turn is given up after anything that queued a record, ran a command out or closed a pane, answers it on its own connection, the way factotum answers the log reads it keeps and acme an event read. Only a read the engine still holds parked is answered, because cloud9 tells the backend nothing of a Tflush, so a flushed read spends no record. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/fs.zig')
-rw-r--r--src/fs.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fs.zig b/src/fs.zig
index 8e2c52a1..50a446dc 100644
--- a/src/fs.zig
+++ b/src/fs.zig
@@ -1243,6 +1243,12 @@ pub const Namespace = struct {
panes: [MAX_PANES]tree.pane.State = @splat(.{}),
listeners: u16 = 0,
origin: u8 = 'K',
+ /// Reads that found nothing yet, one per open that can wait: the log's
+ /// and a run's opens, and one event and one pty/data reader a pane.
+ held: [tree.screen.snapshot_slots + tree.pty.run_slots + 2 * MAX_PANES]?tree.Held = @splat(null),
+ /// Something a held read may be waiting on changed since they were last
+ /// answered: a record queued, a run answered, a pane gone.
+ news: bool = false,
/// The editor-wide event ring: panes made, renamed, saved and closed, and
/// what the editor said. Recorded whether or not anyone reads /log.
log: tree.events.Queue = .{ .cap = limits.log_bytes },