╭ changed ────────╮ │src/serve_ssh.zig│ ╰─────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │77 fn h(ctx: Context, stream: std.Io.net.Stream) void { │ │78 defer stream.close(ctx.io); │ │79 │ │80 - const prev_count = active_connections.fetchAdd(1, .monotonic); │ │81 - defer _ = active_connections.fetchSub(1, .monotonic); │ │80 + const prev_count = active_connections.fetchAdd(1, .acq_rel); │ │81 + defer _ = active_connections.fetchSub(1, .acq_rel); │ │82 if (prev_count >= max_connections) { │ │83 serve_common.logError(ctx.io, ctx.err, "ssh: connection limit reached, dropping\n", .{});│ │84 return; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │153 if (self.idle_state.exempt.load(.acquire)) return false; │ │154 │ │155 // our own work between packets is not the peer idling │ │156 - const seen = self.idle_state.activity.load(.monotonic); │ │156 + const seen = self.idle_state.activity.load(.acquire); │ │157 defer self.last_seen = seen; │ │158 if (self.idle_state.waiting.load(.acquire) and seen == self.last_seen) {│ │159 self.idle_ticks += 1; │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────────╮ │src/serve_ssh_protocol.zig│ ╰──────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │889 } │ │890 │ │891 fn recordActivity(conn: *Conn) void { │ │892 - if (conn.idle) |idle| _ = idle.activity.fetchAdd(1, .monotonic); │ │892 + if (conn.idle) |idle| _ = idle.activity.fetchAdd(1, .acq_rel); │ │893 } │ │894 │ │895 // ---------------------------------------------------------------------------│ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────╮ │src/test/ssh.zig│ ╰────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ │274 }; │ │275 │ │276 try std.testing.expectError(error.EndOfStream, proto.readSessionPacket(&conn)); │ │277 - try std.testing.expectEqual(@as(u64, 0), idle.activity.load(.monotonic)); │ │277 + try std.testing.expectEqual(@as(u64, 0), idle.activity.load(.acquire)); │ │278 } │ │279 │ │280 test "SSH-2 negotiation: walk through every step (banner -> KEX -> auth -> channel -> exec)" {│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯