Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions ffi/zig/src/catalogue.zig
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@

const std = @import("std");

const Mutex = struct {
state: std.atomic.Mutex = .unlocked,
pub fn lock(m: *Mutex) void {
while (!m.state.tryLock()) std.atomic.spinLoopHint();
}
pub fn unlock(m: *Mutex) void {
m.state.unlock();
}
};
// `std.atomic.Mutex` was removed from the standard library; its replacement is
// `std.Thread.Mutex`, whose lock/unlock surface is identical to the hand-rolled
// wrapper this replaces. The wrapper also busy-waited via `spinLoopHint`, burning
// a core under contention; `std.Thread.Mutex` parks the thread instead. 81 other
// files in this repo already use this form.
const Mutex = std.Thread.Mutex;

// ═══════════════════════════════════════════════════════════════════════
// Types (must match src/abi/Catalogue.idr encodings)
Expand Down
15 changes: 6 additions & 9 deletions ffi/zig/src/community.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@

const std = @import("std");

const Mutex = struct {
state: std.atomic.Mutex = .unlocked,
pub fn lock(m: *Mutex) void {
while (!m.state.tryLock()) std.atomic.spinLoopHint();
}
pub fn unlock(m: *Mutex) void {
m.state.unlock();
}
};
// `std.atomic.Mutex` was removed from the standard library; its replacement is
// `std.Thread.Mutex`, whose lock/unlock surface is identical to the hand-rolled
// wrapper this replaces. The wrapper also busy-waited via `spinLoopHint`, burning
// a core under contention; `std.Thread.Mutex` parks the thread instead. 81 other
// files in this repo already use this form.
const Mutex = std.Thread.Mutex;

// ═══════════════════════════════════════════════════════════════════════
// Constants
Expand Down
15 changes: 6 additions & 9 deletions ffi/zig/src/coprocessor.zig
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@

const std = @import("std");

const Mutex = struct {
state: std.atomic.Mutex = .unlocked,
pub fn lock(m: *Mutex) void {
while (!m.state.tryLock()) std.atomic.spinLoopHint();
}
pub fn unlock(m: *Mutex) void {
m.state.unlock();
}
};
// `std.atomic.Mutex` was removed from the standard library; its replacement is
// `std.Thread.Mutex`, whose lock/unlock surface is identical to the hand-rolled
// wrapper this replaces. The wrapper also busy-waited via `spinLoopHint`, burning
// a core under contention; `std.Thread.Mutex` parks the thread instead. 81 other
// files in this repo already use this form.
const Mutex = std.Thread.Mutex;

extern fn getenv(name: [*:0]const u8) ?[*:0]const u8;

Expand Down
15 changes: 6 additions & 9 deletions ffi/zig/src/federation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@

const std = @import("std");

const Mutex = struct {
state: std.atomic.Mutex = .unlocked,
pub fn lock(m: *Mutex) void {
while (!m.state.tryLock()) std.atomic.spinLoopHint();
}
pub fn unlock(m: *Mutex) void {
m.state.unlock();
}
};
// `std.atomic.Mutex` was removed from the standard library; its replacement is
// `std.Thread.Mutex`, whose lock/unlock surface is identical to the hand-rolled
// wrapper this replaces. The wrapper also busy-waited via `spinLoopHint`, burning
// a core under contention; `std.Thread.Mutex` parks the thread instead. 81 other
// files in this repo already use this form.
const Mutex = std.Thread.Mutex;

// ═══════════════════════════════════════════════════════════════════════
// Proven-hardened: Circuit breaker, retry, and rate limiter state
Expand Down
15 changes: 6 additions & 9 deletions ffi/zig/src/guardian.zig
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@

const std = @import("std");

const Mutex = struct {
state: std.atomic.Mutex = .unlocked,
pub fn lock(m: *Mutex) void {
while (!m.state.tryLock()) std.atomic.spinLoopHint();
}
pub fn unlock(m: *Mutex) void {
m.state.unlock();
}
};
// `std.atomic.Mutex` was removed from the standard library; its replacement is
// `std.Thread.Mutex`, whose lock/unlock surface is identical to the hand-rolled
// wrapper this replaces. The wrapper also busy-waited via `spinLoopHint`, burning
// a core under contention; `std.Thread.Mutex` parks the thread instead. 81 other
// files in this repo already use this form.
const Mutex = std.Thread.Mutex;

// ═══════════════════════════════════════════════════════════════════════
// Constants
Expand Down
15 changes: 6 additions & 9 deletions ffi/zig/src/loader.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@

const std = @import("std");

const Mutex = struct {
state: std.atomic.Mutex = .unlocked,
pub fn lock(m: *Mutex) void {
while (!m.state.tryLock()) std.atomic.spinLoopHint();
}
pub fn unlock(m: *Mutex) void {
m.state.unlock();
}
};
// `std.atomic.Mutex` was removed from the standard library; its replacement is
// `std.Thread.Mutex`, whose lock/unlock surface is identical to the hand-rolled
// wrapper this replaces. The wrapper also busy-waited via `spinLoopHint`, burning
// a core under contention; `std.Thread.Mutex` parks the thread instead. 81 other
// files in this repo already use this form.
const Mutex = std.Thread.Mutex;
const crypto = std.crypto;
const fs = std.fs;

Expand Down
15 changes: 6 additions & 9 deletions ffi/zig/src/sdp.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@

const std = @import("std");

const Mutex = struct {
state: std.atomic.Mutex = .unlocked,
pub fn lock(m: *Mutex) void {
while (!m.state.tryLock()) std.atomic.spinLoopHint();
}
pub fn unlock(m: *Mutex) void {
m.state.unlock();
}
};
// `std.atomic.Mutex` was removed from the standard library; its replacement is
// `std.Thread.Mutex`, whose lock/unlock surface is identical to the hand-rolled
// wrapper this replaces. The wrapper also busy-waited via `spinLoopHint`, burning
// a core under contention; `std.Thread.Mutex` parks the thread instead. 81 other
// files in this repo already use this form.
const Mutex = std.Thread.Mutex;

// ═══════════════════════════════════════════════════════════════════════
// Constants
Expand Down
15 changes: 6 additions & 9 deletions ffi/zig/src/sla.zig
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@

const std = @import("std");

const Mutex = struct {
state: std.atomic.Mutex = .unlocked,
pub fn lock(m: *Mutex) void {
while (!m.state.tryLock()) std.atomic.spinLoopHint();
}
pub fn unlock(m: *Mutex) void {
m.state.unlock();
}
};
// `std.atomic.Mutex` was removed from the standard library; its replacement is
// `std.Thread.Mutex`, whose lock/unlock surface is identical to the hand-rolled
// wrapper this replaces. The wrapper also busy-waited via `spinLoopHint`, burning
// a core under contention; `std.Thread.Mutex` parks the thread instead. 81 other
// files in this repo already use this form.
const Mutex = std.Thread.Mutex;

// ═══════════════════════════════════════════════════════════════════════
// Constants
Expand Down
15 changes: 6 additions & 9 deletions ffi/zig/src/verisimdb.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@

const std = @import("std");

const Mutex = struct {
state: std.atomic.Mutex = .unlocked,
pub fn lock(m: *Mutex) void {
while (!m.state.tryLock()) std.atomic.spinLoopHint();
}
pub fn unlock(m: *Mutex) void {
m.state.unlock();
}
};
// `std.atomic.Mutex` was removed from the standard library; its replacement is
// `std.Thread.Mutex`, whose lock/unlock surface is identical to the hand-rolled
// wrapper this replaces. The wrapper also busy-waited via `spinLoopHint`, burning
// a core under contention; `std.Thread.Mutex` parks the thread instead. 81 other
// files in this repo already use this form.
const Mutex = std.Thread.Mutex;
const Allocator = std.mem.Allocator;

// ═══════════════════════════════════════════════════════════════════════
Expand Down
Loading