Skip to content

Instantly share code, notes, and snippets.

View haolian9's full-sized avatar
🐢
make it work, make it right

高浩亮 haolian9

🐢
make it work, make it right
View GitHub Profile
@haolian9
haolian9 / ParkingLot.zig
Created July 10, 2022 14:29 — forked from kprotty/ParkingLot.zig
Small & Fast synchronization primitives for Zig
pub fn ParkingLot(comptime Config: type) type {
return struct {
pub const Lock: type = Config.Lock;
pub const Event: type = Config.Event;
pub const nanotime: fn() u64 = switch (@hasDecl(Config, "nanotime")) {
true => Config.nanotime,