Skip to content

frostium-project/spinlock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spinlock

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.

Usage

First, add the package to your build.zig.zon:
zig fetch --save=spinlock https://github.com/frostium-project/spinlock/archive/v0.0.2.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"));