summaryrefslogtreecommitdiff
path: root/core/Turn.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Turn.zig')
-rw-r--r--core/Turn.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/Turn.zig b/core/Turn.zig
index 687e287f..249c6795 100644
--- a/core/Turn.zig
+++ b/core/Turn.zig
@@ -17,7 +17,6 @@
//! come from a shell performing a save between steps -- so a parked request
//! is never the syscall's own.
const std = @import("std");
-const tape = @import("tape.zig");
const Turn = @This();
@@ -46,6 +45,10 @@ restores: u64 = 0,
lsp_answers: u64 = 0,
/// All of the above, and `out` reaching zero.
settled: std.Io.Condition = .init,
+/// Every `yield`, ever: a replica's step makes none (each syscall of its
+/// core is a tape site), which its tape checks by this count across a
+/// speculation and a replayed input (core/tape.zig `stray`).
+yields: u64 = 0,
/// The editor's thread takes the turn for good; it has it until `stop`.
pub fn start(t: *Turn, io: std.Io) void {
@@ -79,10 +82,7 @@ pub fn wake(t: *Turn) void {
/// a step. Nests: a directory listing that resolves each entry yields
/// inside a yield, and only the outermost one lets go.
pub fn yield(t: *Turn) void {
- // A replica makes no syscall: each is a site of the tape's. One that
- // is none stops a speculation and diverges a replay (it joins
- // again), never the process (a window client's `Term fish`, H17).
- if (tape.replaying()) tape.stray();
+ t.yields +%= 1;
const io = t.io orelse return;
yield_depth += 1;
if (yield_depth != 1) return;