ThatDreche/spinlock
A simple spinlock in Zig
A simple spinlock in zig, with the same API as std.Thread.Mutex. Use this only if you NEED a spinlock, use a proper mutex with OS blessings otherwise.
First, add the package to your build.zig.zon:
zig fetch --save=spinlock https://github.com/ThatDreche/spinlock/archive/v1.0.0.tar.gz
Then, add the following to your build.zig:
const spinlock = b.dependency("spinlock", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("spinlock", spinlock.module("spinlock"));