summaryrefslogtreecommitdiff
path: root/src/agent/watch.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/agent/watch.zig')
-rw-r--r--src/agent/watch.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/agent/watch.zig b/src/agent/watch.zig
index 356dac8..fb46b09 100644
--- a/src/agent/watch.zig
+++ b/src/agent/watch.zig
@@ -7,6 +7,7 @@
const std = @import("std");
const linux = std.os.linux;
const agent = @import("agent.zig");
+const signal = @import("signal.zig");
const Region = struct {
addr: usize,
@@ -65,6 +66,9 @@ pub fn diff() void {
// Busy: another thread is at it, or this one is, below this frame.
if (busy.swap(true, .acquire)) return;
defer busy.store(false, .release);
+ // Whatever key the memory is behind, and whether this thread may read it now.
+ const rights = signal.keys.open();
+ defer if (rights) |was| signal.keys.set(was);
for (table[0..count]) |r| {
var changes: Changes = .{ .old = r.shadow[0..r.len], .new = @as([*]const u8, @ptrFromInt(r.addr))[0..r.len] };
while (changes.next()) |run| agent.write(r.addr + run.at, run.bytes);